Sync with upstream (Issue #30).

Recompiled tier1 and mathlib  for all platforms will come in next commit.
This commit is contained in:
Nicholas Hastings committed 2016-11-30 10:01:15 -05:00
1 parent 98fe5b5a34
commit 3957adff10
491 files changed
+29846 -10698

No files matched your search

+16 -1
View File
@@ -90,8 +90,23 @@ bool CBaseCombatCharacter::Weapon_CanSwitchTo( CBaseCombatWeapon *pWeapon )
if ( m_hActiveWeapon )
{
if ( !m_hActiveWeapon->CanHolster() )
if ( !m_hActiveWeapon->CanHolster() && !pWeapon->ForceWeaponSwitch() )
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;