Effect hooks bug fix

master
AlmTech Software 5 years ago
parent 832b7a62df
commit 4ef0e30c28
  1. 10
      gamemode/engine/lib/sh_effects.lua

@ -51,9 +51,14 @@ if SERVER then -- server only functions
function Quantum.Effect.RemoveRuntimeFunction( pl, effectid, hookID ) function Quantum.Effect.RemoveRuntimeFunction( pl, effectid, hookID )
hookID = hookID || "Quantum_Effects_RunTime_" .. tostring(pl:SteamID64()) .. "_" .. tostring(effectid) hookID = hookID || "Quantum_Effects_RunTime_" .. tostring(pl:SteamID64()) .. "_" .. tostring(effectid)
Quantum.Debug( "Removing runtime effect hook: " .. hookID ) --Quantum.Debug( "Removing runtime effect hook: " .. hookID )
if( pl.effecthooks != nil ) then
PrintTable( pl.effecthooks )
if( pl.effecthooks[hookID] != nil ) then
pl.effecthooks[hookID] = nil pl.effecthooks[hookID] = nil
end
end
hook.Remove( "Think", hookID ) hook.Remove( "Think", hookID )
end end
@ -63,6 +68,9 @@ if SERVER then -- server only functions
for n, hookid in pairs( pl.effecthooks ) do for n, hookid in pairs( pl.effecthooks ) do
Quantum.Effect.RemoveRuntimeFunction( pl, nil, hookid ) Quantum.Effect.RemoveRuntimeFunction( pl, nil, hookid )
end end
pl.effecthooks = {}
else
return
end end
end end

Loading…
Cancel
Save