summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 40604f6d..54717b3b 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -1479,20 +1479,6 @@ void HRpt_Use( gentity_t *self, gentity_t *other, gentity_t *activator )
if( BG_gotItem( UP_BATTPACK, ps->stats ) )
maxAmmo = (int)( (float)maxAmmo * BATTPACK_MODIFIER );
-
-/* BG_unpackAmmoArray( weapon, ps->ammo, ps->powerups, &ammo, &clips, NULL );
-
- if( ammo == maxAmmo && clips < maxClips )
- {
- clips++;
- ammo = 0;
- }
-
- //add half max ammo
- ammo += maxAmmo >> 1;
-
- if( ammo > maxAmmo )
- ammo = maxAmmo;*/
BG_packAmmoArray( weapon, ps->ammo, ps->powerups, maxAmmo, maxClips, maxClips );
@@ -1546,9 +1532,9 @@ void HReactor_Think( gentity_t *self )
//reactor under attack
if( self->health < self->lastHealth &&
- level.time > self->dccAttackTimer && G_isDCC( ) )
+ level.time > level.humanBaseAttackTimer && G_isDCC( ) )
{
- self->dccAttackTimer = level.time + DCC_ATTACK_PERIOD;
+ level.humanBaseAttackTimer = level.time + DCC_ATTACK_PERIOD;
G_BroadcastEvent( EV_DCC_ATTACK, 0 );
}
@@ -2182,6 +2168,16 @@ void HSpawn_Think( gentity_t *self )
G_FreeEntity( ent ); //quietly remove
}
}
+
+ //spawn under attack
+ if( self->health < self->lastHealth &&
+ level.time > level.humanBaseAttackTimer && G_isDCC( ) )
+ {
+ level.humanBaseAttackTimer = level.time + DCC_ATTACK_PERIOD;
+ G_BroadcastEvent( EV_DCC_ATTACK, 0 );
+ }
+
+ self->lastHealth = self->health;
}
self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex );