From cc83e24d9d540d3d59de5d40285382600adb9df6 Mon Sep 17 00:00:00 2001 From: Sin! Date: Sat, 5 Aug 2017 00:01:53 +1000 Subject: [PATCH] [Bugfix] Detector holds active state after it was dropped Steps to reproduce: 1) Take detector into your hands 2) Go to ruck, drop detector from your inventory 3) Close inventory and take dropped detector back. 4) 1st attempt to activate it would be unsuccessful. Hiding sound will be played, but detector won't be shown. Reason - state has not "hidden" value when you drops detector. --- src/xrGame/CustomDetector.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xrGame/CustomDetector.cpp b/src/xrGame/CustomDetector.cpp index bded8b4fac1..93ad945e5c5 100644 --- a/src/xrGame/CustomDetector.cpp +++ b/src/xrGame/CustomDetector.cpp @@ -281,6 +281,13 @@ void CCustomDetector::OnH_B_Independent(bool just_before_destroy) inherited::OnH_B_Independent(just_before_destroy); m_artefacts.clear(); + + if (GetState() != eHidden) + { + // Detaching hud item and animation stop in OnH_A_Independent + TurnDetectorInternal(false); + SwitchState(eHidden); + } } void CCustomDetector::OnMoveToRuck(const SInvItemPlace& prev)