Removing blood client-side trigger as not working. Replaced with small bleeding + explosion. Related to #10.

master
Icedream 2013-12-25 18:45:34 +01:00
parent e05231b293
commit 744a73a3c3
2 changed files with 8 additions and 32 deletions

View File

@ -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)
*
@ -39,13 +39,3 @@ usermessage.Hook("disguiserShootFX", function(um)
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)

View File

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