if-Condition inside disguiserShootFX handler fails terribly.

master
Icedream 2013-12-21 00:16:59 +01:00
parent 6a537cd924
commit 88e00c13e1
2 changed files with 6 additions and 3 deletions

View File

@ -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(

View File

@ -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)