summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_draw.c6
-rw-r--r--src/cgame/cg_main.c9
-rw-r--r--src/cgame/cg_weapons.c5
3 files changed, 7 insertions, 13 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index cc3ab830..42811ef7 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -636,7 +636,7 @@ static void CG_DrawPlayerAmmoValue( rectDef_t *rect, vec4_t color )
int valueMarked = -1;
qboolean bp = qfalse;
- switch( BG_PrimaryWeapon( cg.snap->ps.stats ) )
+ switch( cg.snap->ps.stats[ STAT_WEAPON ] )
{
case WP_NONE:
case WP_BLASTER:
@@ -776,7 +776,7 @@ static void CG_DrawPlayerBuildTimer( rectDef_t *rect, vec4_t color )
if( ps->stats[ STAT_MISC ] <= 0 )
return;
- switch( BG_PrimaryWeapon( ps->stats ) )
+ switch( ps->stats[ STAT_WEAPON ] )
{
case WP_ABUILD:
case WP_ABUILD2:
@@ -812,7 +812,7 @@ static void CG_DrawPlayerClipsValue( rectDef_t *rect, vec4_t color )
int value;
playerState_t *ps = &cg.snap->ps;
- switch( BG_PrimaryWeapon( ps->stats ) )
+ switch( ps->stats[ STAT_WEAPON ] )
{
case WP_NONE:
case WP_BLASTER:
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index fd2d258f..8680aeca 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -400,12 +400,9 @@ static void CG_SetUIVars( void )
*carriageCvar = 0;
//determine what the player is carrying
- for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ )
- {
- if( BG_InventoryContainsWeapon( i, cg.snap->ps.stats ) &&
- BG_Weapon( i )->purchasable )
- strcat( carriageCvar, va( "W%d ", i ) );
- }
+ if( BG_Weapon( cg.snap->ps.stats[ STAT_WEAPON ] )->purchasable )
+ strcat( carriageCvar, va( "W%d ", cg.snap->ps.stats[ STAT_WEAPON ] ) );
+
for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ )
{
if( BG_InventoryContainsUpgrade( i, cg.snap->ps.stats ) &&
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index 0d50e421..6d09d3d9 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -1353,10 +1353,7 @@ CG_WeaponSelectable
*/
static qboolean CG_WeaponSelectable( weapon_t weapon )
{
- if( !BG_InventoryContainsWeapon( weapon, cg.snap->ps.stats ) )
- return qfalse;
-
- return qtrue;
+ return BG_InventoryContainsWeapon( weapon, cg.snap->ps.stats );
}