summaryrefslogtreecommitdiff
path: root/src/game/g_active.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_active.c')
-rw-r--r--src/game/g_active.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c
index d8d7a3d8..ce60daff 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -648,18 +648,14 @@ void ClientTimerActions( gentity_t *ent, int msec )
//client is charging up an lcannon
if( client->ps.weapon == WP_LUCIFER_CANNON )
{
- int ammo;
-
- BG_UnpackAmmoArray( WP_LUCIFER_CANNON, client->ps.ammo, client->ps.powerups, &ammo, NULL );
-
if( client->ps.stats[ STAT_MISC ] < LCANNON_TOTAL_CHARGE && ucmd->buttons & BUTTON_ATTACK )
client->ps.stats[ STAT_MISC ] += ( 100.0f / LCANNON_CHARGE_TIME ) * LCANNON_TOTAL_CHARGE;
if( client->ps.stats[ STAT_MISC ] > LCANNON_TOTAL_CHARGE )
client->ps.stats[ STAT_MISC ] = LCANNON_TOTAL_CHARGE;
- if( client->ps.stats[ STAT_MISC ] > ( ammo * LCANNON_TOTAL_CHARGE ) / 10 )
- client->ps.stats[ STAT_MISC ] = ammo * LCANNON_TOTAL_CHARGE / 10;
+ if( client->ps.stats[ STAT_MISC ] > ( client->ps.ammo * LCANNON_TOTAL_CHARGE ) / 10 )
+ client->ps.stats[ STAT_MISC ] = client->ps.ammo * LCANNON_TOTAL_CHARGE / 10;
}
switch( client->ps.weapon )
@@ -802,8 +798,8 @@ void ClientTimerActions( gentity_t *ent, int msec )
if( ent->health > client->ps.stats[ STAT_MAX_HEALTH ] )
ent->health = client->ps.stats[ STAT_MAX_HEALTH ];
}
-
- // turn off life support when a team admits defeat
+
+ // turn off life support when a team admits defeat
if( client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS &&
level.surrenderTeam == PTE_ALIENS )
{
@@ -824,16 +820,12 @@ void ClientTimerActions( gentity_t *ent, int msec )
if( client->ps.weapon == WP_ALEVEL3_UPG )
{
- int ammo, maxAmmo;
+ int maxAmmo;
BG_FindAmmoForWeapon( WP_ALEVEL3_UPG, &maxAmmo, NULL );
- BG_UnpackAmmoArray( WP_ALEVEL3_UPG, client->ps.ammo, client->ps.powerups, &ammo, NULL );
- if( ammo < maxAmmo )
- {
- ammo++;
- BG_PackAmmoArray( WP_ALEVEL3_UPG, client->ps.ammo, client->ps.powerups, ammo, 0 );
- }
+ if( client->ps.ammo < maxAmmo )
+ client->ps.ammo++;
}
}
}