}
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.
+ // effect to, it means our player is gibbed. Therefore, apply the particles to the gibs as well.
for(head = world; (head = find(head, classname, "gib")); )
{
if(head.team == entnumber)
if(random() < autocvar_cl_damageeffect_gib_probability)
- {
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);
+ // Now apply the effect to the player. This shouldn't be done on gibbed bodies, but there's no way
+ // to tell between them and the respawned player, if both have damage effects at the same time.
+ pointparticles(particleeffectnum(effectnum), org, '0 0 0', 1);
}