aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2010-06-02 15:26:35 +0000
committerMatthew Hoops2010-06-02 15:26:35 +0000
commita8deacfc7eaf6b845d93b7a3f7343b55ee7ec097 (patch)
tree46f0af707c75bf08beaa0a6900a766cc6e1fdd43 /engines/mohawk/riven.cpp
parentaf3fec8c26d92005b507dca65d1d50f820feb0e7 (diff)
downloadscummvm-rg350-a8deacfc7eaf6b845d93b7a3f7343b55ee7ec097.tar.gz
scummvm-rg350-a8deacfc7eaf6b845d93b7a3f7343b55ee7ec097.tar.bz2
scummvm-rg350-a8deacfc7eaf6b845d93b7a3f7343b55ee7ec097.zip
In Riven, if we get a change card opcode on a mouse down event, ignore the next mouse up event so we don't misinterpret that as an event in the next card; minor cleanup.
svn-id: r49393
Diffstat (limited to 'engines/mohawk/riven.cpp')
-rw-r--r--engines/mohawk/riven.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index f3e4703c11..c646855bc7 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -47,6 +47,7 @@ MohawkEngine_Riven::MohawkEngine_Riven(OSystem *syst, const MohawkGameDescriptio
_cardData.hasData = false;
_gameOver = false;
_activatedSLST = false;
+ _ignoreNextMouseUp = false;
_extrasFile = NULL;
// Attempt to let game run from the CDs
@@ -147,10 +148,15 @@ Common::Error MohawkEngine_Riven::run() {
runHotspotScript(_curHotspot, kMouseDownScript);
break;
case Common::EVENT_LBUTTONUP:
- if (_curHotspot >= 0)
- runHotspotScript(_curHotspot, kMouseUpScript);
- else
- checkInventoryClick();
+ // See RivenScript::switchCard() for more information on why we sometimes
+ // disable the next up event.
+ if (!_ignoreNextMouseUp) {
+ if (_curHotspot >= 0)
+ runHotspotScript(_curHotspot, kMouseUpScript);
+ else
+ checkInventoryClick();
+ }
+ _ignoreNextMouseUp = false;
break;
case Common::EVENT_KEYDOWN:
switch (event.kbd.keycode) {