summaryrefslogtreecommitdiff
path: root/src/game/bg_misc.c
diff options
context:
space:
mode:
authorJeff Kent <jeff@jkent.net>2017-04-13 11:30:00 +0000
committer/dev/humancontroller <devhc@example.com>2017-04-15 17:20:41 +0200
commit26e25997647bfcc8692a2209e5670d4c0119ea8c (patch)
treebe69b2f824a6b749e12849a8b6da32e6ca59d1a0 /src/game/bg_misc.c
parentb4c0348da140348f3cbb48cfe544c5682c9e5d34 (diff)
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
Diffstat (limited to 'src/game/bg_misc.c')
-rw-r--r--src/game/bg_misc.c48
1 files changed, 1 insertions, 47 deletions
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
@@ -4959,62 +4959,16 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s
/*
========================
-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
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 );