Skip to content

Commit

Permalink
Allow admins
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonsturgeon committed Nov 12, 2024
1 parent 7e3be5f commit 8547f6a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions moon/wiremod_limits/modules/e2.moon
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ do

subjectIsRagdoll = (args) ->
ent = args[1]
return ent\IsRagdoll!
return ent and ent\IsRagdoll!

subjectWrapper = (original, runtime, args, ...) ->
runtime\forceThrow "[CFC] applyForce functions are disabled on ragdolls" if subjectIsRagdoll args
shouldHalt = subjectIsRagdoll(args) and not runtime.player\IsAdmin!
if shouldHalt
runtime\forceThrow "[CFC] applyForce functions are disabled on ragdolls"

original runtime, args, ...

E2.wrapGroup toEntity, subjectWrapper
Expand All @@ -72,6 +75,9 @@ do
}

disabler = (original, runtime, args, ...) ->
runtime\forceThrow "[CFC] applyForce functions are disabled on bones"
unless runtime.player\IsAdmin!
runtime\forceThrow "[CFC] applyForce functions are disabled on bones"

original runtime, args, ...

E2.wrapGroup toBone, disabler

0 comments on commit 8547f6a

Please sign in to comment.