if-Condition inside disguiserShootFX handler fails terribly.
parent
6a537cd924
commit
88e00c13e1
|
@ -26,14 +26,16 @@
|
|||
*/
|
||||
|
||||
usermessage.Hook("disguiserShootFX", function(um)
|
||||
print("[Disguiser] Received disguiserShootFX")
|
||||
|
||||
local hitpos = um:ReadVector()
|
||||
local hitnormal = um:ReadVectorNormal()
|
||||
local entity = um:ReadEntity()
|
||||
local physbone = um:ReadLong()
|
||||
local bFirstTimePredicted = um:ReadBool()
|
||||
|
||||
// Player and weapon valid?
|
||||
if !IsValid(LocalPlayer()) || !IsValid(LocalPlayer():GetActiveWeapon()) || !!LocalPlayer():GetActiveWeapon().DoShootEffect then return false end
|
||||
// Can we trigger shoot effect yet?
|
||||
if !LocalPlayer():GetActiveWeapon().DoShootEffect then return false end
|
||||
|
||||
// Render shoot effect
|
||||
LocalPlayer():GetActiveWeapon("disguiser"):DoShootEffect(
|
||||
|
|
|
@ -115,7 +115,8 @@ end
|
|||
function SWEP:DoShootEffect(hitpos, hitnormal, entity, physbone, bFirstTimePredicted)
|
||||
|
||||
if SERVER then
|
||||
umsg.Start("disguiserShootFX")
|
||||
print("[Disguiser] Triggering disguiserShootFX on client " .. self.Owner:Name())
|
||||
umsg.Start("disguiserShootFX", self.Owner)
|
||||
umsg.Vector(hitpos)
|
||||
umsg.VectorNormal(hitnormal)
|
||||
umsg.Entity(entity)
|
||||
|
|
Loading…
Reference in New Issue