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