diff options
Diffstat (limited to 'src/game/g_trigger.c')
-rw-r--r-- | src/game/g_trigger.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/game/g_trigger.c b/src/game/g_trigger.c index 2b5b25af..18af97c0 100644 --- a/src/game/g_trigger.c +++ b/src/game/g_trigger.c @@ -1073,7 +1073,7 @@ trigger_ammo_touch */ void trigger_ammo_touch( gentity_t *self, gentity_t *other, trace_t *trace ) { - int ammo, clips, maxClips, maxAmmo; + int maxClips, maxAmmo; if( !other->client ) return; @@ -1099,24 +1099,19 @@ void trigger_ammo_touch( gentity_t *self, gentity_t *other, trace_t *trace ) self->timestamp = level.time + FRAMETIME; BG_FindAmmoForWeapon( other->client->ps.weapon, &maxAmmo, &maxClips ); - BG_UnpackAmmoArray( other->client->ps.weapon, other->client->ps.ammo, other->client->ps.powerups, - &ammo, &clips ); - if( ( ammo + self->damage ) > maxAmmo ) + if( ( other->client->ps.ammo + self->damage ) > maxAmmo ) { - if( clips < maxClips ) + if( other->client->ps.clips < maxClips ) { - clips++; - ammo = 1; + other->client->ps.clips++; + other->client->ps.ammo = 1; } else - ammo = maxAmmo; + other->client->ps.ammo = maxAmmo; } else - ammo += self->damage; - - BG_PackAmmoArray( other->client->ps.weapon, other->client->ps.ammo, other->client->ps.powerups, - ammo, clips ); + other->client->ps.ammo += self->damage; } /* |