mp/src/game/client/sdk/hud/sdk_hud_weaponselection.cpp
void CHudWeaponSelection::FastWeaponSwitch( int iWeaponSlot )
{
	// get the slot the player's weapon is in
	C_SDKPlayer *pPlayer = C_SDKPlayer::GetLocalSDKPlayer();
	if ( !pPlayer )
		return;

	if (iWeaponSlot < 0 || iWeaponSlot >= DA_MAX_WEAPON_SLOTS)
		return;

	if (!m_ahWeaponSlots[iWeaponSlot])
	{
		pPlayer->EmitSound( "Player.DenyWeaponSelection" );
		return;
	}

	if (pPlayer->GetActiveSDKWeapon() == GetSelectedWeapon())
		return;

	m_flDeployGoal = 1;

	// select the new weapon
	::input->MakeWeaponSelection( m_ahWeaponSlots[iWeaponSlot] );
}
//-----------------------------------------------------------------------------
// Purpose: Opens the next weapon in the slot
//-----------------------------------------------------------------------------
Opens the next weapon in the slot
Opens the next weapon in the slot
void CHudWeaponSelection::FastWeaponSwitch( int iWeaponSlot )
{
	C_SDKPlayer *pPlayer = C_SDKPlayer::GetLocalSDKPlayer();
	if ( !pPlayer )
		return;
	if (iWeaponSlot < 0 || iWeaponSlot >= DA_MAX_WEAPON_SLOTS)
		return;
	if (!m_ahWeaponSlots[iWeaponSlot])
	{
		pPlayer->EmitSound( "Player.DenyWeaponSelection" );
		return;
	}
	if (pPlayer->GetActiveSDKWeapon() == GetSelectedWeapon())
		return;
	m_flDeployGoal = 1;
	::input->MakeWeaponSelection( m_ahWeaponSlots[iWeaponSlot] );
}
void CHudWeaponSelection :: FastWeaponSwitch ( int iWeaponSlot ) { C_SDKPlayer * pPlayer = C_SDKPlayer :: GetLocalSDKPlayer ( ) ; if ( ! pPlayer ) return ; if ( iWeaponSlot < 0 || iWeaponSlot >= DA_MAX_WEAPON_SLOTS ) return ; if ( ! m_ahWeaponSlots [ iWeaponSlot ] ) { pPlayer -> EmitSound ( " " ) ; return ; } if ( pPlayer -> GetActiveSDKWeapon ( ) == GetSelectedWeapon ( ) ) return ; m_flDeployGoal = 1 ; :: input -> MakeWeaponSelection ( m_ahWeaponSlots [ iWeaponSlot ] ) ; }
Purpose: Opens the next weapon in the slot
Purpose : Opens the next weapon in the slot
// get the slot the player's weapon is in // select the new weapon