diff --git a/src/game/baseq2/g_combat.c b/src/game/baseq2/g_combat.c index 59cd0647..3b8567bd 100644 --- a/src/game/baseq2/g_combat.c +++ b/src/game/baseq2/g_combat.c @@ -172,13 +172,8 @@ Killed(edict_t *targ, edict_t *inflictor, edict_t *attacker, } void -SpawnDamage(int type, vec3_t origin, vec3_t normal, int damage) +SpawnDamage(int type, vec3_t origin, vec3_t normal) { - if (damage > 255) - { - damage = 255; - } - gi.WriteByte(svc_temp_entity); gi.WriteByte(type); gi.WritePosition(origin); @@ -310,7 +305,7 @@ CheckPowerArmor(edict_t *ent, vec3_t point, vec3_t normal, int damage, save = damage; } - SpawnDamage(pa_te_type, point, normal, save); + SpawnDamage(pa_te_type, point, normal); ent->powerarmor_time = level.time + 0.2; power_used = save / damagePerCell; @@ -387,7 +382,7 @@ CheckArmor(edict_t *ent, vec3_t point, vec3_t normal, int damage, } client->pers.inventory[index] -= save; - SpawnDamage(te_sparks, point, normal, save); + SpawnDamage(te_sparks, point, normal); return save; } @@ -399,6 +394,11 @@ M_ReactToDamage(edict_t *targ, edict_t *attacker) { return; } + + if (targ->health <= 0) + { + return; + } if (!(attacker->client) && !(attacker->svflags & SVF_MONSTER)) { @@ -628,7 +628,7 @@ T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, { take = 0; save = damage; - SpawnDamage(te_sparks, point, normal, save); + SpawnDamage(te_sparks, point, normal); } /* check for invincibility */ @@ -666,11 +666,11 @@ T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, { if ((targ->svflags & SVF_MONSTER) || (client)) { - SpawnDamage(TE_BLOOD, point, normal, take); + SpawnDamage(TE_BLOOD, point, normal); } else { - SpawnDamage(te_sparks, point, normal, take); + SpawnDamage(te_sparks, point, normal); } targ->health = targ->health - take;