@@ -67,41 +67,54 @@ if SERVER then
67
67
end
68
68
69
69
function ENTITY :CPPICanTool (ply , tool )
70
- local Value = FPP .Protect .CanTool (ply , nil , tool , self )
71
- if Value ~= false and Value ~= true then Value = true end
72
- return Value
70
+ local cantool = FPP .Protect .CanTool (ply , nil , tool , self )
71
+ if cantool == nil then cantool = true end
72
+ return cantool
73
73
end
74
74
75
75
function ENTITY :CPPICanPhysgun (ply )
76
- return FPP .plyCanTouchEnt (ply , self , " Physgun" )
76
+ local canphysgun = FPP .Protect .PhysgunPickup (ply , self )
77
+ if canphysgun == nil then canphysgun = true end
78
+ return canphysgun
77
79
end
78
80
79
81
function ENTITY :CPPICanPickup (ply )
80
- return FPP .plyCanTouchEnt (ply , self , " Gravgun" )
82
+ local canpickup = FPP .Protect .CanGravGunPickup (ply , self )
83
+ if canpickup == nil then canpickup = true end
84
+ return canpickup
81
85
end
82
86
83
87
function ENTITY :CPPICanPunt (ply )
84
- return FPP .plyCanTouchEnt (ply , self , " Gravgun" )
88
+ local canpunt = FPP .Protect .GravGunPunt (ply , self )
89
+ if canpunt == nil then canpunt = true end
90
+ return canpunt
85
91
end
86
92
87
93
function ENTITY :CPPICanUse (ply )
88
- return FPP .plyCanTouchEnt (ply , self , " PlayerUse" )
94
+ local canuse = FPP .Protect .PlayerUse (ply , self )
95
+ if canuse == nil then canuse = true end
96
+ return canuse
89
97
end
90
98
91
99
function ENTITY :CPPICanDamage (ply )
92
- return FPP .plyCanTouchEnt (ply , self , " EntityDamage" )
100
+ local dmginfo = DamageInfo ()
101
+ dmginfo :SetAttacker (ply )
102
+ dmginfo :SetDamage (- 1 )
103
+
104
+ FPP .Protect .EntityDamage (self , dmginfo )
105
+ return dmginfo :GetDamage () ~= 0
93
106
end
94
107
95
108
function ENTITY :CPPIDrive (ply )
96
- local Value = FPP .Protect .CanDrive (ply , self )
97
- if Value ~= false and Value ~= true then Value = true end
98
- return Value
109
+ local candrive = FPP .Protect .CanDrive (ply , self )
110
+ if candrive == nil then candrive = true end
111
+ return candrive
99
112
end
100
113
101
114
function ENTITY :CPPICanProperty (ply , property )
102
- local Value = FPP .Protect .CanProperty (ply , property , self )
103
- if Value ~= false and Value ~= true then Value = true end
104
- return Value
115
+ local canproperty = FPP .Protect .CanProperty (ply , property , self )
116
+ if canproperty == nil then canproperty = true end
117
+ return canproperty
105
118
end
106
119
107
120
function ENTITY :CPPICanEditVariable (ply , key , val , editTbl )
0 commit comments