Index: src/game/g_cmds.c =================================================================== --- src/game/g_cmds.c (revision 813) +++ src/game/g_cmds.c (working copy) @@ -1759,7 +1759,7 @@ void Cmd_ToggleItem_f( gentity_t *ent ) { char s[ MAX_TOKEN_CHARS ]; - int upgrade, weapon, i; + int upgrade, weapon; trap_Argv( 1, s, sizeof( s ) ); upgrade = BG_FindUpgradeNumForName( s ); @@ -1776,24 +1776,8 @@ if( ent->client->ps.weapon != WP_BLASTER ) weapon = WP_BLASTER; else - { - //find a held weapon which isn't the blaster - for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ ) - { - if( i == WP_BLASTER ) - continue; + weapon = G_FindNonBlasterWeapon( ent ); - if( BG_InventoryContainsWeapon( i, ent->client->ps.stats ) ) - { - weapon = i; - break; - } - } - - if( i == WP_NUM_WEAPONS ) - weapon = WP_BLASTER; - } - G_ForceWeaponChange( ent, weapon ); } else if( BG_InventoryContainsUpgrade( upgrade, ent->client->ps.stats ) ) @@ -1842,8 +1826,11 @@ upgrade = BG_FindUpgradeNumForName( s ); //special case to keep norf happy - if( weapon == WP_NONE && upgrade == UP_AMMO ) - buyingEnergyAmmo = BG_FindUsesEnergyForWeapon( ent->client->ps.weapon ); + if( weapon == WP_NONE && upgrade == UP_AMMO ) { + // we don't buy ammo for blaster, we buy it for main weapon! + int mainWeapon = G_FindNonBlasterWeapon( ent ); + buyingEnergyAmmo = BG_FindUsesEnergyForWeapon( mainWeapon ); + } if( buyingEnergyAmmo ) {