From: Mircea Kitsune Date: Thu, 25 Aug 2011 15:29:54 +0000 (+0300) Subject: Tweak some gib code and comments for the damage effects X-Git-Tag: xonotic-v0.6.0~110^2^2~95 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=38df354bd3d66246bf025893e602330c3831ecfa;p=xonotic%2Fxonotic-data.pk3dir.git Tweak some gib code and comments for the damage effects --- diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 03eb15f6c..1387a4658 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -247,23 +247,27 @@ void Ent_DamageEffect_Think() if(!entcs) return; - // 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 the particles to the gibs as well. - if(autocvar_cl_damageeffect_gibs) + // 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. + float foundgib; + entity head; + for(head = world; (head = find(head, classname, "gib")); ) { - entity head; - for(head = world; (head = find(head, classname, "gib")); ) + if(head.team == self.team) { - if(head.team == self.team) + if(autocvar_cl_damageeffect_gibs) pointparticles(self.partnum, head.origin, '0 0 0', 1); + foundgib = TRUE; } } + if(foundgib) // don't show effects on the invisible dead body if gibs exist + return; // if we aren't in third person mode, hide our own damage effect if(self.team == player_localentnum - 1 && !autocvar_chase_active) return; - // Now apply the effect to the actual player. + // Now apply the effect to actual players pointparticles(self.partnum, entcs.origin, '0 0 0', 1); }