diff options
Diffstat (limited to 'src/game/bg_misc.c')
-rw-r--r-- | src/game/bg_misc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 15361e64..08484549 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -4797,6 +4797,24 @@ void BG_PackAmmoArray( int weapon, int ammo[ ], int ammo2[ ], int quan, int clip /* ======================== +BG_WeaponIsFull + +Check if a weapon has full ammo +======================== +*/ +qboolean BG_WeaponIsFull( weapon_t weapon, int ammo[ ], int ammo2[ ] ) +{ + int maxAmmo, maxClips; + int quan, clips; + + BG_FindAmmoForWeapon( weapon, &maxAmmo, NULL, &maxClips ); + BG_UnpackAmmoArray( weapon, ammo, ammo2, &quan, &clips, NULL ); + + return ( maxAmmo == quan ) && ( maxClips == clips ); +} + +/* +======================== BG_AddWeaponToInventory Give a player a weapon |