From e69913011da3aa34196dd70635451a6dc0742712 Mon Sep 17 00:00:00 2001 From: Timm Luyten Date: Wed, 13 Sep 2023 16:06:39 +0300 Subject: [PATCH] Fix sniper scope switch-out bug --- code/swb_base/WeaponBase.cs | 1 + code/swb_base/attachments/BodyGroupSight.HunterScope2D.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/code/swb_base/WeaponBase.cs b/code/swb_base/WeaponBase.cs index fbc27737..10e7a25a 100644 --- a/code/swb_base/WeaponBase.cs +++ b/code/swb_base/WeaponBase.cs @@ -69,6 +69,7 @@ public override void ActiveEnd(Entity ent, bool dropped) { // Attachments HandleAttachments(false); + wasZooming = false; base.ActiveEnd(ent, dropped); } diff --git a/code/swb_base/attachments/BodyGroupSight.HunterScope2D.cs b/code/swb_base/attachments/BodyGroupSight.HunterScope2D.cs index a3ae8828..c6ed0cbb 100644 --- a/code/swb_base/attachments/BodyGroupSight.HunterScope2D.cs +++ b/code/swb_base/attachments/BodyGroupSight.HunterScope2D.cs @@ -27,6 +27,12 @@ public class HunterScope2D : BodyGroupSight "100% accurate while scoped in" }; + public override void OnUnequip(WeaponBase weapon) + { + base.OnUnequip(weapon); + OnZoomEnd(weapon); + } + public override void OnZoomStart(WeaponBase weapon) { WeaponBaseSniper.OnScopeStart(weapon, ZoomInSound, ZoomInDelay);