@@ -145,7 +145,7 @@ function ents_methods:parent ( ent )
145145 local ent = unwrap ( ent )
146146 local this = unwrap ( self )
147147
148- if not SF .Permissions .check ( SF .instance .player , { this , ent }, " entities.parent" ) then return end
148+ if not SF .Permissions .check ( SF .instance .player , { this , ent }, " entities.parent" ) then SF . throw ( " Insufficient permissions " , 2 ) end
149149
150150 if not isValid ( ent ) then return false , " entity not valid" end
151151 if not parent_check ( this , ent ) then return false , " cannot parent to self" end
155155
156156function ents_methods :unparent ()
157157 local this = unwrap (self )
158- if not SF .Permissions .check ( SF .instance .player , this , " entities.unparent" ) then return end
158+ if not SF .Permissions .check ( SF .instance .player , this , " entities.unparent" ) then SF . throw ( " Insufficient permissions " , 2 ) end
159159 this :SetParent ( nil )
160160end
161161
@@ -172,7 +172,7 @@ function ents_methods:applyForceCenter(vec)
172172 local phys = getPhysObject (ent )
173173 if not phys then return false , " entity has no physics object" end
174174
175- if not SF .Permissions .check ( SF .instance .player , ent , " entities.applyForce" ) then return end
175+ if not SF .Permissions .check ( SF .instance .player , ent , " entities.applyForce" ) then SF . throw ( " Insufficient permissions " , 2 ) end
176176
177177 phys :ApplyForceCenter ( vec )
178178
@@ -193,7 +193,7 @@ function ents_methods:applyForceOffset(vec, offset)
193193 local phys = getPhysObject (ent )
194194 if not phys then return false , " entity has no physics object" end
195195
196- if not SF .Permissions .check ( SF .instance .player , ent , " entities.applyForce" ) then return end
196+ if not SF .Permissions .check ( SF .instance .player , ent , " entities.applyForce" ) then SF . throw ( " Insufficient permissions " , 2 ) end
197197
198198 phys :ApplyForceOffset ( vec , offset )
199199
@@ -212,7 +212,7 @@ function ents_methods:applyAngForce(ang)
212212 local phys = getPhysObject (ent )
213213 if not phys then return false , " entity has no physics object" end
214214
215- if not SF .Permissions .check ( SF .instance .player , ent , " entities.applyForce" ) then return end
215+ if not SF .Permissions .check ( SF .instance .player , ent , " entities.applyForce" ) then SF . throw ( " Insufficient permissions " , 2 ) end
216216
217217 -- assign vectors
218218 local up = ent :GetUp ()
@@ -255,7 +255,7 @@ function ents_methods:applyTorque(tq)
255255 local phys = getPhysObject (ent )
256256 if not phys then return false , " entity has no physics object" end
257257
258- if not SF .Permissions .check ( SF .instance .player , ent , " entities.applyForce" ) then return end
258+ if not SF .Permissions .check ( SF .instance .player , ent , " entities.applyForce" ) then SF . throw ( " Insufficient permissions " , 2 ) end
259259
260260 local torqueamount = tq :Length ()
261261
@@ -289,7 +289,7 @@ function ents_methods:setPos(vec)
289289 local ent = unwrap (self )
290290 if not isValid (ent ) then return false , " entity not valid" end
291291
292- if not SF .Permissions .check ( SF .instance .player , ent , " entities.setPos" ) then return end
292+ if not SF .Permissions .check ( SF .instance .player , ent , " entities.setPos" ) then SF . throw ( " Insufficient permissions " , 2 ) end
293293
294294 SF .setPos ( ent , vec )
295295
@@ -305,7 +305,7 @@ function ents_methods:setAngles(ang)
305305 local ent = unwrap (self )
306306 if not isValid (ent ) then return false , " entity not valid" end
307307
308- if not SF .Permissions .check ( SF .instance .player , ent , " entities.setAngles" ) then return end
308+ if not SF .Permissions .check ( SF .instance .player , ent , " entities.setAngles" ) then SF . throw ( " Insufficient permissions " , 2 ) end
309309
310310 SF .setAng ( ent , ang )
311311
@@ -323,7 +323,7 @@ function ents_methods:setVelocity(vel)
323323 local phys = getPhysObject (ent )
324324 if not phys then return false , " entity has no physics object" end
325325
326- if not SF .Permissions .check ( SF .instance .player , ent , " entities.setVelocity" ) then return end
326+ if not SF .Permissions .check ( SF .instance .player , ent , " entities.setVelocity" ) then SF . throw ( " Insufficient permissions " , 2 ) end
327327
328328 phys :SetVelocity (vel )
329329 return true
@@ -339,7 +339,7 @@ function ents_methods:setFrozen(freeze)
339339 local phys = getPhysObject (ent )
340340 if not phys then return false , " entity has no physics object" end
341341
342- if not SF .Permissions .check ( SF .instance .player , ent , " entities.setFrozen" ) then return end
342+ if not SF .Permissions .check ( SF .instance .player , ent , " entities.setFrozen" ) then SF . throw ( " Insufficient permissions " , 2 ) end
343343
344344 phys :EnableMotion (not (freeze and true or false ))
345345 phys :Wake ()
@@ -366,7 +366,7 @@ function ents_methods:setSolid ( solid )
366366 local ent = unwrap ( self )
367367 if not isValid ( ent ) then return false , " entity not valid" end
368368
369- if not SF .Permissions .check ( SF .instance .player , ent , " entities.setSolid" ) then return end
369+ if not SF .Permissions .check ( SF .instance .player , ent , " entities.setSolid" ) then SF . throw ( " Insufficient permissions " , 2 ) end
370370
371371 ent :SetNotSolid ( not solid )
372372end
@@ -381,7 +381,7 @@ function ents_methods:enableGravity(grav)
381381 local phys = getPhysObject (ent )
382382 if not phys then return false , " entity has no physics object" end
383383
384- if not SF .Permissions .check ( SF .instance .player , ent , " entities.enableGravity" ) then return end
384+ if not SF .Permissions .check ( SF .instance .player , ent , " entities.enableGravity" ) then SF . throw ( " Insufficient permissions " , 2 ) end
385385
386386 phys :EnableGravity (grav and true or false )
387387 phys :Wake ()
0 commit comments