From d3978db574ea98093190ae5c99854d69f3899d04 Mon Sep 17 00:00:00 2001 From: Peter Covington Date: Thu, 21 Apr 2022 22:56:24 -0400 Subject: [PATCH] Fixed custom gun not reseting zoom when holstered --- sp/src/game/server/mapbase/weapon_custom_hl2.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sp/src/game/server/mapbase/weapon_custom_hl2.cpp b/sp/src/game/server/mapbase/weapon_custom_hl2.cpp index 834bad2c..7c8241bc 100644 --- a/sp/src/game/server/mapbase/weapon_custom_hl2.cpp +++ b/sp/src/game/server/mapbase/weapon_custom_hl2.cpp @@ -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: //-----------------------------------------------------------------------------