From 26e25997647bfcc8692a2209e5670d4c0119ea8c Mon Sep 17 00:00:00 2001 From: Jeff Kent Date: Thu, 13 Apr 2017 11:30:00 +0000 Subject: multi-protocol: change the playerState_t and entityState_t structs to the versions in the latest code base this includes changing how ammo and clips r stored --- src/game/bg_misc.c | 48 +----------------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) (limited to 'src/game/bg_misc.c') diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 1a55ed0..2641305 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -4957,50 +4957,6 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s s->otherEntityNum = ps->otherEntityNum; } -/* -======================== -BG_UnpackAmmoArray - -Extract the ammo quantity from the array -======================== -*/ -void BG_UnpackAmmoArray( int weapon, int psAmmo[ ], int psAmmo2[ ], int *ammo, int *clips ) -{ - int ammoarray[ 32 ]; - int i; - - for( i = 0; i <= 15; i++ ) - ammoarray[ i ] = psAmmo[ i ]; - - for( i = 16; i <= 31; i++ ) - ammoarray[ i ] = psAmmo2[ i - 16 ]; - - if( ammo != NULL ) - *ammo = ammoarray[ weapon ] & 0x0FFF; - - if( clips != NULL ) - *clips = ( ammoarray[ weapon ] >> 12 ) & 0x0F; -} - -/* -======================== -BG_PackAmmoArray - -Pack the ammo quantity into the array -======================== -*/ -void BG_PackAmmoArray( int weapon, int psAmmo[ ], int psAmmo2[ ], int ammo, int clips ) -{ - int weaponvalue; - - weaponvalue = ammo | ( clips << 12 ); - - if( weapon <= 15 ) - psAmmo[ weapon ] = weaponvalue; - else if( weapon >= 16 ) - psAmmo2[ weapon - 16 ] = weaponvalue; -} - /* ======================== BG_WeaponIsFull @@ -5008,13 +4964,11 @@ BG_WeaponIsFull Check if a weapon has full ammo ======================== */ -qboolean BG_WeaponIsFull( weapon_t weapon, int stats[ ], int psAmmo[ ], int psAmmo2[ ] ) +qboolean BG_WeaponIsFull( weapon_t weapon, int stats[ ], int ammo, int clips ) { int maxAmmo, maxClips; - int ammo, clips; BG_FindAmmoForWeapon( weapon, &maxAmmo, &maxClips ); - BG_UnpackAmmoArray( weapon, psAmmo, psAmmo2, &ammo, &clips ); if( BG_InventoryContainsUpgrade( UP_BATTPACK, stats ) ) maxAmmo = (int)( (float)maxAmmo * BATTPACK_MODIFIER ); -- cgit