From dce1a493a7df370cb4134647d703ebd5c0a28232 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Thu, 25 Aug 2011 22:51:35 +0300 Subject: [PATCH] Revert entcs back, and use getplayerorigin() to get the origin for the effect --- qcsrc/client/damage.qc | 8 ++++---- qcsrc/server/ent_cs.qc | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 6bf0181dc..c264dd5eb 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -246,7 +246,7 @@ void Ent_DamageEffect_Think() self.nextthink = time; float foundgib; - entity entcs; + vector org; if(time >= self.lifetime) { @@ -256,8 +256,8 @@ void Ent_DamageEffect_Think() } if(self.dmgtime > time) return; - entcs = entcs_receiver[self.team]; - if(!entcs) + org = getplayerorigin(self.team); + if(org == GETPLAYERORIGIN_ERROR) return; // Scan the owner of all gibs in the world. If a gib owner is the same as the player we're applying @@ -283,7 +283,7 @@ void Ent_DamageEffect_Think() return; // if we aren't in third person mode, hide own damage effect // Now apply the effect to actual players - pointparticles(self.dmgpartnum, entcs.origin, '0 0 0', 1); + pointparticles(self.dmgpartnum, org, '0 0 0', 1); self.dmgtime = time + autocvar_cl_damageeffect_player; } diff --git a/qcsrc/server/ent_cs.qc b/qcsrc/server/ent_cs.qc index e1b0efb67..9c4bf5975 100644 --- a/qcsrc/server/ent_cs.qc +++ b/qcsrc/server/ent_cs.qc @@ -24,16 +24,15 @@ float entcs_customize() { entity o; o = self.owner; - //if(o.deadflag != DEAD_NO) // allow sending entcs for dead players, for damage effects to work. To be decided! - // return FALSE; + if(o.deadflag != DEAD_NO) + return FALSE; if(o.classname != "player") return FALSE; - //if(other == o) // allow sending entcs for self, for damage effects to work. To be decided! - // return FALSE; + if(other == o) + return FALSE; if(other.classname == "player") if(!teamplay || o.team != other.team) - //if not (radar_showennemies) - if not (checkpvs(other.origin + other.view_ofs, o)) // allow sending entcs for enemies in view, for damage effects to work. To be decided! + if not (radar_showennemies) return FALSE; return TRUE; } -- 2.39.2