aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorBastien Bouclet2018-05-18 19:26:36 +0200
committerBastien Bouclet2018-05-18 19:28:27 +0200
commit43babaeef8ff385b1f10be1c2fa917085afd2f88 (patch)
tree19935f1155b728d96e11e1f6fe0cb56a5f92bb64 /engines/mohawk
parentcedeb537a7f2d209b356601839555152a2aec32a (diff)
downloadscummvm-rg350-43babaeef8ff385b1f10be1c2fa917085afd2f88.tar.gz
scummvm-rg350-43babaeef8ff385b1f10be1c2fa917085afd2f88.tar.bz2
scummvm-rg350-43babaeef8ff385b1f10be1c2fa917085afd2f88.zip
MOHAWK: RIVEN: Always release the prison combination buttons
Fixes Trac#10525.
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/riven_stacks/pspit.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/engines/mohawk/riven_stacks/pspit.cpp b/engines/mohawk/riven_stacks/pspit.cpp
index 37d159ff94..3c8b4306e4 100644
--- a/engines/mohawk/riven_stacks/pspit.cpp
+++ b/engines/mohawk/riven_stacks/pspit.cpp
@@ -87,6 +87,19 @@ void PSpit::xpisland990_elevcombo(const ArgumentArray &args) {
_vm->delay(500);
_vm->_cursor->showCursor();
+ // If the user released the mouse button during the wait time, the mouse up event
+ // is not forwarded to the game script handler. The button appears to be down
+ // until the user moves the mouse outside of the button hotspot.
+ // This happens with the original engine as well.
+ // To work around this issue we run the mouse up script if the mouse is not
+ // pressed anymore at this point.
+ if (!mouseIsDown()) {
+ Common::String buttonName = Common::String::format("combo%d", args[0]);
+ RivenHotspot *button = _vm->getCard()->getHotspotByName(buttonName);
+ RivenScriptPtr mouseUpScript = button->getScript(kMouseUpScript);
+ _vm->_scriptMan->runScript(mouseUpScript, false);
+ }
+
// It is impossible to get here if Gehn is not trapped. However,
// the original also disallows brute forcing the ending if you have
// not yet trapped Gehn.