From: Mircea Kitsune Date: Thu, 25 Aug 2011 14:44:01 +0000 (+0300) Subject: Get the damage effects PARTLY working again. They will only show on team mates so... X-Git-Tag: xonotic-v0.6.0~110^2^2~99 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=923de6130311b7a95fdd3d9044ad1cd1ee1ca9a1;p=xonotic%2Fxonotic-data.pk3dir.git Get the damage effects PARTLY working again. They will only show on team mates so far, due to an apparent entcs bug (entcs not being sent to enemies of the player). --- diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index fe2e8b67b..6a5855fe4 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -236,7 +236,7 @@ void DamageInfo_Precache() } .entity dmgeffect; -.string dmgparticles; +.float partnum; void Ent_DamageEffect_Think() { @@ -256,18 +256,16 @@ void Ent_DamageEffect_Think() { if(head.team == self.team) if(random() < autocvar_cl_damageeffect_gibs) - pointparticles(particleeffectnum(self.dmgparticles), head.origin, '0 0 0', 1); + pointparticles(self.partnum, head.origin, '0 0 0', 1); } } // if we aren't in third person mode, hide our own damage effect - if(self.team == player_localentnum) - if(!autocvar_chase_active) + if(self.team == player_localentnum && !autocvar_chase_active) return; // Now apply the effect to the actual player. - if(random() < autocvar_cl_damageeffect) - pointparticles(particleeffectnum(self.dmgparticles), entcs.origin, '0 0 0', 1); + pointparticles(self.partnum, entcs.origin, '0 0 0', 1); } void Ent_DamageEffect() @@ -305,7 +303,7 @@ void Ent_DamageEffect() entity head; for(head = world; (head = find(head, classname, "dmgeffect")); ) { - if(head.team == entnumber) + if(head.team == entnumber - 1) { remove(head); head = world; @@ -315,8 +313,8 @@ void Ent_DamageEffect() entity e; e = spawn(); e.classname = "dmgeffect"; - e.team = entnumber; - e.dmgparticles = effectnum; + e.team = entnumber - 1; + e.partnum = particleeffectnum(effectnum); e.think = Ent_DamageEffect_Think; e.nextthink = time; }