From 179cd6b1d0f70d7bc75a4fbf7dcefa0460fcf805 Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Thu, 8 Oct 2009 15:56:19 +0000 Subject: [PATCH] Fixt einen Crash beim Benutzen der lasergranaten --- src/g_combat.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/g_combat.c b/src/g_combat.c index 6e54501..99ae457 100644 --- a/src/g_combat.c +++ b/src/g_combat.c @@ -252,7 +252,7 @@ static int CheckPowerArmor (edict_t *ent, vec3_t point, vec3_t normal, int damag if (client) client->pers.inventory[index] -= power_used; - else + else if (ent->svflags & SVF_MONSTER) ent->monsterinfo.power_armor_power -= power_used; return save; } @@ -521,8 +521,10 @@ void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir, SpawnDamage (te_sparks, point, normal, take); - targ->health = targ->health - take; - + if (targ->takedamage != DAMAGE_IMMORTAL) + targ->health = targ->health - take; + + // kill the entity if (targ->health <= 0) { if ((targ->svflags & SVF_MONSTER) || (client))