From dbf4174c18e50013ef0a3d96092085d701c99408 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Wed, 4 Jan 2012 16:59:32 +0200 Subject: [PATCH] First part of bone-based damage effects: The origin of the effects is now a given player bone, not the player's origin --- qcsrc/client/damage.qc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index a9e8d4cbd..eaa2fd4f9 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -241,6 +241,7 @@ void DamageInfo_Precache() .entity dmgent; .float dmgpartnum, dmgtime; .float lifetime; +.float bone; void DamageEffect_Think() { @@ -257,9 +258,9 @@ void DamageEffect_Think() } if(self.dmgtime > time) return; - org = getplayerorigin(self.team); - if(org == GETPLAYERORIGIN_ERROR) - return; + + org = gettaginfo(self.owner, self.bone); + //dprint(strcat(vtos(gettaginfo(self.owner, self.bone)), " --------\n")); // Scan the owner of all gibs in the world. If a gib owner is the same as the player we're applying // the effect to, it means our player is gibbed. Therefore, apply particles to the gibs instead. @@ -327,6 +328,8 @@ void DamageEffect(float dmg, float type, float specnum, float entnumber) entity e; e = spawn(); + e.owner = self; + e.bone = 0; e.classname = "damageeffect"; e.team = entnumber; e.dmgpartnum = particleeffectnum(effectnum); -- 2.39.2