mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-08 01:39:36 +00:00
add source-sdk-2013
This commit is contained in:
@@ -90,23 +90,8 @@ bool CBaseCombatCharacter::Weapon_CanSwitchTo( CBaseCombatWeapon *pWeapon )
|
||||
|
||||
if ( m_hActiveWeapon )
|
||||
{
|
||||
if ( !m_hActiveWeapon->CanHolster() && !pWeapon->ForceWeaponSwitch() )
|
||||
if ( !m_hActiveWeapon->CanHolster() )
|
||||
return false;
|
||||
|
||||
if ( IsPlayer() )
|
||||
{
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)this;
|
||||
// check if active weapon force the last weapon to switch
|
||||
if ( m_hActiveWeapon->ForceWeaponSwitch() )
|
||||
{
|
||||
// last weapon wasn't allowed to switch, don't allow to switch to new weapon
|
||||
CBaseCombatWeapon *pLastWeapon = pPlayer->GetLastWeapon();
|
||||
if ( pLastWeapon && pWeapon != pLastWeapon && !pLastWeapon->CanHolster() && !pWeapon->ForceWeaponSwitch() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user