aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsluicebox2019-02-20 22:50:07 -0800
committerFilippos Karapetis2019-02-25 07:56:58 +0200
commitd1b1bd5381ea76872a2d464a918d0d191f4d6044 (patch)
tree24046659b0e881b646df6e0ed71123ba552822fc
parent727e583b94b80e299a2b6c52e67a7b99ec3558b8 (diff)
downloadscummvm-rg350-d1b1bd5381ea76872a2d464a918d0d191f4d6044.tar.gz
scummvm-rg350-d1b1bd5381ea76872a2d464a918d0d191f4d6044.tar.bz2
scummvm-rg350-d1b1bd5381ea76872a2d464a918d0d191f4d6044.zip
SCI: Fix LONGBOW Day 8 archer pathfinding
Work around a lockup that occurs due to our pathfinding, bug #10896
-rw-r--r--engines/sci/engine/script_patches.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 93122c7071..2db70a480d 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -3997,6 +3997,29 @@ static const uint16 longbowPatchAmigaPubFix[] = {
PATCH_END
};
+// WORKAROUND: Script needed, because of differences in our pathfinding
+// algorithm
+// When the guards kick Robin out of archery room 320 the game locks up due to
+// pathfinding algorithm differences. Ours sends ego in the wrong direction,
+// colliding with a guard, and preventing the script from continuing.
+//
+// Applies to: English PC Floppy, German PC Floppy, English Amiga Floppy
+// Responsible method: takeHimOut:changeState(1)
+// Fixes bug: #10896
+static const uint16 longbowSignatureArcherPathfinding[] = {
+ SIG_MAGICDWORD,
+ 0x38, SIG_UINT16(0x00c8), // pushi 00c8 [ y = 200 ]
+ 0x7c, // pushSelf
+ 0x81, 0x00, // lag 00
+ 0x4a, 0x0c, // send 0c [ ego setMotion: PolyPath (ego x?) 200 self ]
+ SIG_END
+};
+
+static const uint16 longbowPatchArcherPathfinding[] = {
+ 0x38, PATCH_UINT16(0x00c4), // pushi 00c4 [ y = 196 ]
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry longbowSignatures[] = {
{ true, 150, "day 5/6 camp sunset fix", 2, longbowSignatureCampSunsetFix, longbowPatchCampSunsetFix },
@@ -4005,6 +4028,7 @@ static const SciScriptPatcherEntry longbowSignatures[] = {
{ true, 225, "arithmetic berry bush fix", 1, longbowSignatureBerryBushFix, longbowPatchBerryBushFix },
{ true, 250, "day 5/6 rescue flag fix", 1, longbowSignatureRescueFlagFix, longbowPatchRescueFlagFix },
{ true, 260, "day 5/6 town map sunset fix", 1, longbowSignatureTownMapSunsetFix, longbowPatchTownMapSunsetFix },
+ { true, 320, "day 8 archer pathfinding workaround", 1, longbowSignatureArcherPathfinding, longbowPatchArcherPathfinding },
{ true, 350, "day 9 cobbler hut fix", 10, longbowSignatureCobblerHut, longbowPatchCobblerHut },
{ true, 530, "amiga pub fix", 1, longbowSignatureAmigaPubFix, longbowPatchAmigaPubFix },
SCI_SIGNATUREENTRY_TERMINATOR