@@ -62,38 +62,33 @@ if SERVER then
62
62
63
63
function ENTITY :CPPISetOwnerUID (UID )
64
64
local ply = UID and player .GetByUniqueID (tostring (UID )) or nil
65
- if UID and not IsValid ( ply ) then return false end
65
+ if UID and not ply then return false end
66
66
return self :CPPISetOwner (ply )
67
67
end
68
68
69
69
function ENTITY :CPPICanTool (ply , tool )
70
70
local cantool = FPP .Protect .CanTool (ply , nil , tool , self )
71
- if cantool == nil then cantool = true end
72
- return cantool
71
+ return cantool == nil and true or cantool
73
72
end
74
73
75
74
function ENTITY :CPPICanPhysgun (ply )
76
75
local canphysgun = FPP .Protect .PhysgunPickup (ply , self )
77
- if canphysgun == nil then canphysgun = true end
78
- return canphysgun
76
+ return canphysgun == nil and true or canphysgun
79
77
end
80
78
81
79
function ENTITY :CPPICanPickup (ply )
82
80
local canpickup = FPP .Protect .CanGravGunPickup (ply , self )
83
- if canpickup == nil then canpickup = true end
84
- return canpickup
81
+ return canpickup == nil and true or canpickup
85
82
end
86
83
87
84
function ENTITY :CPPICanPunt (ply )
88
85
local canpunt = FPP .Protect .GravGunPunt (ply , self )
89
- if canpunt == nil then canpunt = true end
90
- return canpunt
86
+ return canpunt == nil and true or canpunt
91
87
end
92
88
93
89
function ENTITY :CPPICanUse (ply )
94
90
local canuse = FPP .Protect .PlayerUse (ply , self )
95
- if canuse == nil then canuse = true end
96
- return canuse
91
+ return canuse == nil and true or canuse
97
92
end
98
93
99
94
function ENTITY :CPPICanDamage (ply )
@@ -107,14 +102,12 @@ if SERVER then
107
102
108
103
function ENTITY :CPPIDrive (ply )
109
104
local candrive = FPP .Protect .CanDrive (ply , self )
110
- if candrive == nil then candrive = true end
111
- return candrive
105
+ return candrive == nil and true or candrive
112
106
end
113
107
114
108
function ENTITY :CPPICanProperty (ply , property )
115
109
local canproperty = FPP .Protect .CanProperty (ply , property , self )
116
- if canproperty == nil then canproperty = true end
117
- return canproperty
110
+ return canproperty == nil and true or canproperty
118
111
end
119
112
120
113
function ENTITY :CPPICanEditVariable (ply , key , val , editTbl )
0 commit comments