aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorVhati2018-12-01 14:40:28 -0500
committerFilippos Karapetis2018-12-01 21:40:28 +0200
commite6dbdb880fc436df317fcf5e6636b371592bc5d0 (patch)
tree05cb59156b80319f81f9e8866772203641ae6465 /engines/sci/engine
parentb37e946d7547cb9439fb6cf2fbb451aace8cdd4a (diff)
downloadscummvm-rg350-e6dbdb880fc436df317fcf5e6636b371592bc5d0.tar.gz
scummvm-rg350-e6dbdb880fc436df317fcf5e6636b371592bc5d0.tar.bz2
scummvm-rg350-e6dbdb880fc436df317fcf5e6636b371592bc5d0.zip
SCI32: Fix QFG4 fortune teller crash (#1421)
Fixes room disposal when leaving Magda's wagon, bug #10778
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/script_patches.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 07604da5ce..29ec62db75 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -8027,6 +8027,31 @@ static const uint16 qfg4SetScalerPatch[] = {
PATCH_END
};
+// When the fortune teller's wagon room is disposed, it attempts to call
+// hero::show(), hero has a null "plane" property, and ScummVM crashes.
+//
+// The problematic line was removed in the CD edition. We remove it, too.
+//
+// Note: This patch is a workaround. The floppy edition SSCI did not crash, and
+// its implementation of AddScreenItem() should be checked to find out why.
+//
+// Applies to at least: English floppy, German floppy
+// Responsible method: rm470::dispose()
+// Fixes bug: #10778
+static const uint16 qfg4MagdaDisposalSignature[] = {
+ 0x38, SIG_SELECTOR16(posn), // posn
+ SIG_ADDTOOFFSET(+8), // ...
+ SIG_MAGICDWORD,
+ 0x81, 0x00, // lag global[0] (hero)
+ 0x4a, SIG_UINT16(0x000c), // send 12d (posn: 1000 1000 show:)
+ SIG_END
+};
+
+static const uint16 qfg4MagdaDisposalPatch[] = {
+ 0x33, 0x0e, // jmp 14d (skip the entire hero send)
+ PATCH_END
+};
+
// The castle's crest-operated bookshelf has an unconditional HAND message
// which always says, "you haven't found the trigger yet," even after it's
// open.
@@ -8231,6 +8256,7 @@ static const SciScriptPatcherEntry qfg4Signatures[] = {
{ true, 320, "fix pathfinding at the inn", 1, qg4InnPathfindingSignature, qg4InnPathfindingPatch },
{ true, 320, "fix talking to absent innkeeper", 1, qfg4AbsentInnkeeperSignature, qfg4AbsentInnkeeperPatch },
{ true, 440, "fix setLooper calls (1/2)", 1, qg4SetLooperSignature1, qg4SetLooperPatch1 },
+ { true, 470, "fix Magda room disposal", 1, qfg4MagdaDisposalSignature, qfg4MagdaDisposalPatch },
{ true, 530, "fix setLooper calls (1/2)", 4, qg4SetLooperSignature1, qg4SetLooperPatch1 },
{ true, 535, "fix setLooper calls (1/2)", 4, qg4SetLooperSignature1, qg4SetLooperPatch1 },
{ true, 541, "fix setLooper calls (1/2)", 5, qg4SetLooperSignature1, qg4SetLooperPatch1 },