Permalink
Browse files

SCI32: Fix QFG4 fortune teller crash (#1421)

Fixes room disposal when leaving Magda's wagon, bug #10778
  • Loading branch information...
Vhati authored and bluegr committed Dec 1, 2018
1 parent b37e946 commit e6dbdb880fc436df317fcf5e6636b371592bc5d0
Showing with 26 additions and 0 deletions.
  1. +26 −0 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 },

0 comments on commit e6dbdb8

Please sign in to comment.