From: Mircea Kitsune Date: Sun, 3 Apr 2011 16:53:32 +0000 (+0300) Subject: Second part of my latest change. When a body is gibbed, the damage effect will apply... X-Git-Tag: xonotic-v0.6.0~110^2^2~143 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=466891e8a15f93ca3aa4cc060a9e117ef7d5fa11;p=xonotic%2Fxonotic-data.pk3dir.git Second part of my latest change. When a body is gibbed, the damage effect will apply to the gibs instead of him. This will need much more work, as showing the same effect on each gib causes too many particles. --- diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index 76f6aaa5e..65c6468aa 100644 --- a/qcsrc/client/gibs.qc +++ b/qcsrc/client/gibs.qc @@ -315,5 +315,21 @@ void Ent_DamageEffect() effectnum = substring(effectnum, 0, strlen(effectnum) - 1); // remove the _ symbol at the end of the species name } - pointparticles(particleeffectnum(effectnum), org, '0 0 0', 1); + entity head; + float foundgib; + + // 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 instead. + for(head = world; (head = find(head, classname, "gib")); ) + { + if(head.team == entnumber) + { + pointparticles(particleeffectnum(effectnum), head.origin, '0 0 0', 1); + foundgib = TRUE; + } + } + + // If our player isn't gibbed, apply the effect to him instead. + if(!foundgib) + pointparticles(particleeffectnum(effectnum), org, '0 0 0', 1); }