diff --git a/lua/weapons/disguiser/cl_fxfake.lua b/lua/weapons/disguiser/cl_fxfake.lua index 116818e..75e81d0 100644 --- a/lua/weapons/disguiser/cl_fxfake.lua +++ b/lua/weapons/disguiser/cl_fxfake.lua @@ -5,8 +5,8 @@ * cl_fxfake.lua * * Purpose: - * Fake shoot and blood effect on client-side via a trigger from server-side, - * as for some reason the effects are not rendered on client-side automatically. + * Fake client-side effects via a user message trigger from server-side, as for some + * reason these effects are not rendered on client-side automatically. * * Copyright (C) 2013 Carl Kittelberger (Icedream) * @@ -38,14 +38,4 @@ usermessage.Hook("disguiserShootFX", function(um) -- Render shoot effect swep:DoShootEffect( hitpos, hitnormal, entity, physbone, bFirstTimePredicted) -end) - -usermessage.Hook("disguiserBlood", function(um) - local edata = EffectData() - edata:SetStart(um:ReadVector()) - edata:SetOrigin(um:ReadVector()) - edata:SetNormal(um:ReadVectorNormal()) - edata:SetEntity(um:ReadEntity()) - util.Effect("BloodImpact", edata) - util.Decal("Splash.Large", um:ReadVector(), um:ReadVector()) end) \ No newline at end of file diff --git a/lua/weapons/disguiser/init.lua b/lua/weapons/disguiser/init.lua index 412bf8d..67ab1eb 100644 --- a/lua/weapons/disguiser/init.lua +++ b/lua/weapons/disguiser/init.lua @@ -364,29 +364,15 @@ hook.Add("PlayerDeath", "Disguiser.ThirdPersonDeath", function(victim, inflictor dentity:Fire("kill", "", 2) dentity:Fire("enablemotion","",0) - // Manually draw additional blood (for some reason setting the blood color has no effect) - local traceworld = {} - traceworld.start = victim:GetPos() + Vector(0, 0, 20) - traceworld.endpos = traceworld.start + (Vector(0,0,-1) * 8000) // aim max. 8000 units down - traceworld.filter = victim - local trw = util.TraceLine(traceworld) // Send the trace and get the results. - local edata = EffectData() - edata:SetStart(victim:GetPos() - physics:GetVelocity()) - edata:SetOrigin(victim:GetPos()) - edata:SetNormal(trw.Normal) - edata:SetEntity(dentity) + // Let the entity bleed wahahaha. I'm mad, ain't I? util.Effect("BloodImpact", edata) util.Decal("Splash.Large", trw.HitPos + trw.HitNormal, trw.HitPos - trw.HitNormal) - // Make it appear on clientside of victim - umsg.Start("disguiserBlood", victim) - umsg.Vector(victim:GetPos() - physics:GetVelocity()) - umsg.Vector(victim:GetPos()) - umsg.VectorNormal(trw.Normal) - umsg.Entity(dentity) - umsg.Vector(trw.HitPos + trw.HitNormal) - umsg.Vector(trw.HitPos - trw.HitNormal) - umsg.End() + // BOOOOM! + local boomFx = ents.Create("env_explosion") + boomFx:SetPos(dentity:GetPos()) + boomFx:Spawn() + boomFx.Fire("explode", "", 0) end end)