Fixed custom gun not reseting zoom when holstered

This commit is contained in:
Peter Covington 2022-04-21 22:56:24 -04:00
parent 37019140bd
commit d3978db574

View File

@ -386,6 +386,7 @@ public:
virtual void ItemPostFrame(void); // called each frame by the player PostThink
virtual void ItemBusyFrame(void); // called each frame by the player PostThink, if the player's not ready to attack yet
virtual bool ReloadOrSwitchWeapons(void);
virtual bool Holster(CBaseCombatWeapon* pSwitchingTo = NULL);
// Bullet launch information
virtual const Vector& GetBulletSpread(void);
@ -782,6 +783,17 @@ void CHLCustomWeaponGun::AddViewKick(void)
}
}
bool CHLCustomWeaponGun::Holster(CBaseCombatWeapon* pSwitchingTo)
{
// Stop zooming
if (m_bInZoom)
{
ToggleZoom();
}
return BaseClass::Holster(pSwitchingTo);
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------