aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBastien Bouclet2017-03-18 06:40:02 +0100
committerBastien Bouclet2017-03-18 16:15:09 +0100
commit060caebf47838b7466cbd44a5aeb13e24641af94 (patch)
tree874937da6505927392814460b7170dc4871a8599 /engines
parent213e73038883f2b8498d666bb70851f648198579 (diff)
downloadscummvm-rg350-060caebf47838b7466cbd44a5aeb13e24641af94.tar.gz
scummvm-rg350-060caebf47838b7466cbd44a5aeb13e24641af94.tar.bz2
scummvm-rg350-060caebf47838b7466cbd44a5aeb13e24641af94.zip
MOHAWK: In Myst v1.0 English the take page opcode takes no arguments
Fixes #9645, crash when trying to take a book page.
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/myst_scripts.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp
index 596180ddb2..267d644b65 100644
--- a/engines/mohawk/myst_scripts.cpp
+++ b/engines/mohawk/myst_scripts.cpp
@@ -355,7 +355,26 @@ void MystScriptParser::o_changeCardSwitchRtL(uint16 op, uint16 var, uint16 argc,
}
void MystScriptParser::o_takePage(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
- uint16 cursorId = argv[0];
+ // In most game releases, the first opcode argument is the new mouse cursor.
+ // However, in the original v1.0 English release this opcode takes no argument.
+ uint16 cursorId; // = argv[0];
+ switch (var) {
+ case 41: // Vault white page
+ cursorId = kWhitePageCursor;
+ break;
+ case 25: // Fireplace red page
+ case 102: // Red page
+ cursorId = kRedPageCursor;
+ break;
+ case 24: // Fireplace blue page
+ case 103: // Blue page
+ cursorId = kBluePageCursor;
+ break;
+ default:
+ warning("Unexpected take page variable '%d'", var);
+ cursorId = kDefaultMystCursor;
+ }
+
uint16 oldPage = _globals.heldPage;
debugC(kDebugScript, "Opcode %d: takePage Var %d CursorId %d", op, var, cursorId);