From 27a7a67778a1cd59e24ffe756b68cdd8888e19d4 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 2 Feb 2019 13:30:44 +0100 Subject: MOHAWK: RIVEN: Prevent the card leave script from recursing Recursion would happen when multiple events are received in the same frame. This could happen when mashing both the mouse and the keyboard to move around faster, as noticed by a speedrunner. --- engines/mohawk/riven_card.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engines/mohawk/riven_card.cpp b/engines/mohawk/riven_card.cpp index 555688ce7e..9026f2e8fb 100644 --- a/engines/mohawk/riven_card.cpp +++ b/engines/mohawk/riven_card.cpp @@ -917,10 +917,12 @@ void RivenCard::leave() { if (_pressedHotspot) { script += _pressedHotspot->getScript(kMouseUpScript); + _pressedHotspot = nullptr; } if (_hoveredHotspot) { script += _hoveredHotspot->getScript(kMouseLeaveScript); + _hoveredHotspot = nullptr; } script += getScript(kCardLeaveScript); -- cgit v1.2.3