]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Tweak some gib code and comments for the damage effects
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 25 Aug 2011 15:29:54 +0000 (18:29 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 25 Aug 2011 15:29:54 +0000 (18:29 +0300)
qcsrc/client/damage.qc

index 03eb15f6ca871bc349039fc31f60896c6c881a2d..1387a465858c2ceb52250b4d2ea50e64c0810132 100644 (file)
@@ -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);
 }