Fix -1 (unlimited) ammo decreasing ammo time remaining

Gauntlet and Grappling Hook use -1 ammo. Gauntlet is excluded from
the check ammo loop but Grappling Hook causes ammo time remaining
to decrease 200 milliseconds.

The out of ammo check tests time remaining is equal to zero. This
means carrying Grappling Hook and out of ammo will have negative
time remaining which results in the low ammo message being displayed
instead of out of ammo.
This commit is contained in:
Zack Middleton 2017-11-10 20:28:50 -06:00
parent 471ea9e564
commit 4af2c91fbf
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@ void CG_CheckAmmo( void ) {
if ( ! ( weapons & ( 1 << i ) ) ) {
continue;
}
if ( cg.cur_ps->ammo[i] < 0 ) {
continue;
}
switch ( i ) {
case WP_ROCKET_LAUNCHER:
case WP_GRENADE_LAUNCHER: