summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2003-09-27 03:16:58 +0000
committerTim Angus <tim@ngus.net>2003-09-27 03:16:58 +0000
commit2c917c986c82fafafe2b58a61479657997d80718 (patch)
tree7cf2cd7195f30481e073d1c1c32034d6b0d9b52a /src/game/g_buildable.c
parenta17c3a4d4a9a719a630e7a3a78d640e950337d21 (diff)
* weapon.cfg files changed a bit to include sections for alternate fire modes
* Close to zero weapon specific client side code now remains * Poison cloud effect now uses new particle system * Fixed a couple of bugs in the particle system
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 50b64f1c..2d4a19c7 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -1280,10 +1280,12 @@ Use for human power repeater
*/
void HRpt_Use( gentity_t *self, gentity_t *other, gentity_t *activator )
{
- int maxAmmo, maxClips;
- int ammo, clips;
-
+ int maxAmmo, maxClips;
+ int ammo, clips;
+ weapon_t weapon;
playerState_t *ps = &activator->client->ps;
+
+ weapon = ps->weapon;
if( !self->spawned )
return;
@@ -1291,15 +1293,15 @@ void HRpt_Use( gentity_t *self, gentity_t *other, gentity_t *activator )
if( activator->client->lastRefilTime + ENERGY_REFIL_TIME > level.time )
return;
- if( !BG_FindUsesEnergyForWeapon( ps->weapon ) )
+ if( !BG_FindUsesEnergyForWeapon( weapon ) )
return;
- BG_FindAmmoForWeapon( ps->weapon, &maxAmmo, NULL, &maxClips );
+ BG_FindAmmoForWeapon( weapon, &maxAmmo, NULL, &maxClips );
if( BG_gotItem( UP_BATTPACK, ps->stats ) )
maxAmmo = (int)( (float)maxAmmo * BATTPACK_MODIFIER );
- BG_unpackAmmoArray( ps->weapon, ps->ammo, ps->powerups, &ammo, &clips, NULL );
+ BG_unpackAmmoArray( weapon, ps->ammo, ps->powerups, &ammo, &clips, NULL );
if( ammo == maxAmmo && clips < maxClips )
{
@@ -1313,7 +1315,7 @@ void HRpt_Use( gentity_t *self, gentity_t *other, gentity_t *activator )
if( ammo > maxAmmo )
ammo = maxAmmo;
- BG_packAmmoArray( ps->weapon, ps->ammo, ps->powerups, ammo, clips, maxClips );
+ BG_packAmmoArray( weapon, ps->ammo, ps->powerups, ammo, clips, maxClips );
G_AddEvent( activator, EV_RPTUSE_SOUND, 0 );
activator->client->lastRefilTime = level.time;