aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Bouclet2019-02-02 13:30:44 +0100
committerBastien Bouclet2019-02-02 13:30:44 +0100
commit27a7a67778a1cd59e24ffe756b68cdd8888e19d4 (patch)
tree355791f8e7a4d274171fbc123089672aab64ffcc
parent19d92484fdbae556a5238b13535e34f8436f399b (diff)
downloadscummvm-rg350-27a7a67778a1cd59e24ffe756b68cdd8888e19d4.tar.gz
scummvm-rg350-27a7a67778a1cd59e24ffe756b68cdd8888e19d4.tar.bz2
scummvm-rg350-27a7a67778a1cd59e24ffe756b68cdd8888e19d4.zip
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.
-rw-r--r--engines/mohawk/riven_card.cpp2
1 files changed, 2 insertions, 0 deletions
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);