diff options
author | enneract <trem.redman@gmail.com> | 2015-01-08 00:42:15 +0100 |
---|---|---|
committer | enneract <trem.redman@gmail.com> | 2015-01-08 00:42:15 +0100 |
commit | 96bede71e66823dc28a57935e48e4cc7b17f55af (patch) | |
tree | 26dbd475a40bdf1d3412d5a7d5c9ad23a16c8bd5 /src/game/g_weapon.c | |
parent | 96f8e06ec9aa117bb8dd7e8d671d93e3884cb98f (diff) |
Fix various linking errors and segfaults.
Diffstat (limited to 'src/game/g_weapon.c')
-rw-r--r-- | src/game/g_weapon.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 2aa9563..5779aec 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -1476,19 +1476,18 @@ static void G_CreateNewZap( gentity_t *creator, gentity_t *target ) // the zap chains only through living entities if( target->health > 0 ) { - if (target->client->ps.stats[ STAT_TEAM ] != TEAM_ALIENS) - G_Damage( target, creator, creator, forward, - target->s.origin, LEVEL2_AREAZAP_DMG, - DAMAGE_NO_KNOCKBACK | DAMAGE_NO_LOCDAMAGE, - MOD_LEVEL2_ZAP ); + if( !target->client || target->client->ps.stats[ STAT_TEAM ] != TEAM_ALIENS ) + G_Damage( target, creator, creator, forward, target->s.origin, LEVEL2_AREAZAP_DMG, + DAMAGE_NO_KNOCKBACK | DAMAGE_NO_LOCDAMAGE, MOD_LEVEL2_ZAP ); G_FindZapChainTargets( zap ); for( i = 1; i < zap->numTargets; i++ ) { - if (zap->targets[ i ]->client->ps.stats[ STAT_TEAM ] != TEAM_ALIENS) - G_Damage( zap->targets[ i ], target, zap->creator, forward, target->s.origin, - LEVEL2_AREAZAP_DMG * ( 1 - pow( (zap->distances[ i ] / + if( !zap->targets[ i ]->client || + zap->targets[ i ]->client->ps.stats[ STAT_TEAM ] != TEAM_ALIENS ) + G_Damage( zap->targets[ i ], target, zap->creator, forward, target->s.origin, + LEVEL2_AREAZAP_DMG * ( 1 - pow( (zap->distances[ i ] / LEVEL2_AREAZAP_CHAIN_RANGE ), LEVEL2_AREAZAP_CHAIN_FALLOFF ) ) + 1, DAMAGE_NO_KNOCKBACK | DAMAGE_NO_LOCDAMAGE, MOD_LEVEL2_ZAP ); |