aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorsluicebox2018-12-02 13:19:35 -0800
committerFilippos Karapetis2018-12-02 23:19:35 +0200
commit58653c7917dc897b678958305ca0c167cce00c99 (patch)
treeb62157068b795c58c4e117349bcea69512ff2032 /engines/sci
parent673cc0ed9e126543685de6db53c45f3c7536781b (diff)
downloadscummvm-rg350-58653c7917dc897b678958305ca0c167cce00c99.tar.gz
scummvm-rg350-58653c7917dc897b678958305ca0c167cce00c99.tar.bz2
scummvm-rg350-58653c7917dc897b678958305ca0c167cce00c99.zip
SCI: Fix SQ5 drive bay pathfinding, bug #7155 (#1428)
Works around a pathfinding algorithm edge case
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/script_patches.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index d68eb0cb35..06dacab14d 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -8960,9 +8960,35 @@ static const uint16 sq5PatchToolboxFix[] = {
PATCH_END
};
-// script, description, signature patch
+// After entering the drive bay (room 1000) through the hallway, clicking walk
+// in most places causes ego to automatically turn around and return to the
+// previous room. This is due to differences in our pathfinding algorithm from
+// Sierra's which results in ego first walking backwards into the control area
+// that triggers the script sExitToHall.
+//
+// We work around this by adjusting ego's initial MoveTo position by a few
+// pixels to one which doesn't cause pathfinding to send ego backwards.
+//
+// Applies to: PC Floppy
+// Responsible method: sEnterFromHall:changeState(0)
+// Fixes bug #7155
+static const uint16 sq5SignatureDriveBayPathfindingFix[] = {
+ SIG_MAGICDWORD,
+ 0x39, 0x0e, // pushi 0e [ x = 14d ]
+ 0x39, 0x6e, // pushi 6e [ y = 110d ]
+ SIG_END
+};
+
+static const uint16 sq5PatchDriveBayPathfindingFix[] = {
+ 0x39, 0x10, // pushi 10 [ x = 16d ]
+ 0x39, 0x6f, // pushi 6f [ y = 111d ]
+ PATCH_END
+};
+
+// script, description, signature patch
static const SciScriptPatcherEntry sq5Signatures[] = {
- { true, 226, "toolbox fix", 1, sq5SignatureToolboxFix, sq5PatchToolboxFix },
+ { true, 226, "toolbox fix", 1, sq5SignatureToolboxFix, sq5PatchToolboxFix },
+ { true, 1000, "drive bay pathfinding fix", 1, sq5SignatureDriveBayPathfindingFix, sq5PatchDriveBayPathfindingFix },
SCI_SIGNATUREENTRY_TERMINATOR
};