diff options
author | Tim Angus <tim@ngus.net> | 2005-09-02 00:50:41 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2005-09-02 00:50:41 +0000 |
commit | f0dd8ef319694b8ef5ccfe4b8bf806477c7125be (patch) | |
tree | 2408ffafc8a9766ab21b00304f799abfa3965b88 /src/cgame | |
parent | e7939256c27f42cbdec1a3648482563118c628d1 (diff) |
* Fixed a spectating bug introduced by the new weapon switching
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_weapons.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 3f468b21..df33af35 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -1317,17 +1317,17 @@ WEAPON SELECTION CG_WeaponSelectable =============== */ -static qboolean CG_WeaponSelectable( int i ) +static qboolean CG_WeaponSelectable( weapon_t weapon ) { - int ammo, clips; - - BG_UnpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips ); - + //int ammo, clips; + // + //BG_UnpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips ); + // //TA: this is a pain in the ass //if( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( i ) ) // return qfalse; - if( !BG_InventoryContainsWeapon( i, cg.snap->ps.stats ) ) + if( !BG_InventoryContainsWeapon( weapon, cg.snap->ps.stats ) ) return qfalse; return qtrue; @@ -1339,9 +1339,9 @@ static qboolean CG_WeaponSelectable( int i ) CG_UpgradeSelectable =============== */ -static qboolean CG_UpgradeSelectable( int i ) +static qboolean CG_UpgradeSelectable( upgrade_t upgrade ) { - if( !BG_InventoryContainsUpgrade( i, cg.snap->ps.stats ) ) + if( !BG_InventoryContainsUpgrade( upgrade, cg.snap->ps.stats ) ) return qfalse; return qtrue; @@ -1378,11 +1378,14 @@ void CG_DrawItemSelect( rectDef_t *rect, vec4_t color ) if( cg.predictedPlayerState.stats[ STAT_HEALTH ] <= 0 ) return; - // first make sure that whatever it selected is actually selectable - if( cg.weaponSelect <= 32 && !CG_WeaponSelectable( cg.weaponSelect ) ) - CG_NextWeapon_f( ); - else if( cg.weaponSelect > 32 && !CG_UpgradeSelectable( cg.weaponSelect ) ) - CG_NextWeapon_f( ); + if( !( cg.snap->ps.pm_flags & PMF_FOLLOW ) ) + { + // first make sure that whatever it selected is actually selectable + if( cg.weaponSelect <= 32 && !CG_WeaponSelectable( cg.weaponSelect ) ) + CG_NextWeapon_f( ); + else if( cg.weaponSelect > 32 && !CG_UpgradeSelectable( cg.weaponSelect ) ) + CG_NextWeapon_f( ); + } // showing weapon select clears pickup item display, but not the blend blob cg.itemPickupTime = 0; |