From f2198c70e7961cbea1857fa042f89a3ff2038f5d Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Fri, 23 Jan 2009 20:12:45 +0000 Subject: [PATCH] fix potential segfault (found by DerSaidin in xreal) --- code/game/g_combat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/g_combat.c b/code/game/g_combat.c index e24b6fa7..65386567 100644 --- a/code/game/g_combat.c +++ b/code/game/g_combat.c @@ -974,7 +974,8 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, } // add to the attacker's hit counter (if the target isn't a general entity like a prox mine) - if ( attacker->client && targ != attacker && targ->health > 0 + if ( attacker->client && client + && targ != attacker && targ->health > 0 && targ->s.eType != ET_MISSILE && targ->s.eType != ET_GENERAL) { if ( OnSameTeam( targ, attacker ) ) {