fix potential segfault (found by DerSaidin in xreal)

This commit is contained in:
Ludwig Nussel 2009-01-23 20:12:45 +00:00
parent f5aae78481
commit f2198c70e7
1 changed files with 2 additions and 1 deletions

View File

@ -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 ) ) {