summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/g_buildable.c5
-rw-r--r--src/game/g_combat.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index f64d7307..2881982b 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -1314,6 +1314,9 @@ void HFM_Touch( gentity_t *self, gentity_t *other, trace_t *trace )
if( self->health <= 0 )
return;
+ if( other && other->client && other->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
+ return;
+
//go boom
G_Damage( self, NULL, NULL, NULL, NULL, 10000, 0, MOD_SUICIDE );
}
@@ -1333,6 +1336,8 @@ void HFM_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int da
dir[ 0 ] = dir[ 1 ] = 0;
dir[ 2 ] = -1;
+ self->takedamage = qfalse;
+
//do a bit of radius damage
G_RadiusDamage( self->s.pos.trBase, self->parent, self->splashDamage,
self->splashRadius, self, self->splashMethodOfDeath );
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 391c09b6..a7cf150b 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -230,7 +230,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
AddScore( self, -1 );
}
- if( self->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS )
+ if( attacker && attacker->client && self->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS )
{
int clientNum = attacker->client->ps.clientNum;
float denominator, numerator = self->credits[ clientNum ];
@@ -980,7 +980,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
}
// do the damage
- if(take)
+ if( take )
{
targ->health = targ->health - take;
if( targ->client )
@@ -997,7 +997,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
if( client )
targ->flags |= FL_NO_KNOCKBACK;
- if (targ->health < -999)
+ if( targ->health < -999 )
targ->health = -999;
targ->enemy = attacker;