Skip to content

Commit cc83e24

Browse files
gunslingermodXottab-DUTY
authored andcommitted
[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.
1 parent 705040f commit cc83e24

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/xrGame/CustomDetector.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,13 @@ void CCustomDetector::OnH_B_Independent(bool just_before_destroy)
281281
inherited::OnH_B_Independent(just_before_destroy);
282282

283283
m_artefacts.clear();
284+
285+
if (GetState() != eHidden)
286+
{
287+
// Detaching hud item and animation stop in OnH_A_Independent
288+
TurnDetectorInternal(false);
289+
SwitchState(eHidden);
290+
}
284291
}
285292

286293
void CCustomDetector::OnMoveToRuck(const SInvItemPlace& prev)

0 commit comments

Comments
 (0)