diff options
author | Filippos Karapetis | 2013-01-24 22:21:29 +0200 |
---|---|---|
committer | Filippos Karapetis | 2013-01-24 22:25:09 +0200 |
commit | b0cfe968b00424866f4f3c45f3eaf6639f6da4df (patch) | |
tree | 4645ada2fa26f6e0823ffea0b459633a7f77a1e7 /engines/sci/engine | |
parent | 454542eba130b5ac7d5fb21b90509a1d4118cc95 (diff) | |
download | scummvm-rg350-b0cfe968b00424866f4f3c45f3eaf6639f6da4df.tar.gz scummvm-rg350-b0cfe968b00424866f4f3c45f3eaf6639f6da4df.tar.bz2 scummvm-rg350-b0cfe968b00424866f4f3c45f3eaf6639f6da4df.zip |
SCI: Fix bug #3585189 - "SCI: QFG1VGA - game hangs in the tavern"
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/script_patches.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 8639b6ef71..f6e64bbd6e 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -883,12 +883,45 @@ const uint16 qfg1vgaPatchDialogHeader[] = { PATCH_END }; +// When clicking on the crusher in room 331, Ego approaches him to talk to him. +// There is a block placed in front of the crusher, where Ego stops. Script 331 +// is responsible for moving Ego, in moveToCrusher::changeState. Apparently, +// the script parameters are an edge case, since the script sets Ego to move +// much closer to the crusher than is possible, because of the block in front of +// him, thus the scripts wait forever for MoveTo to move Ego to the requested +// location, which never happens, and the game freezes. Normally, the scripts +// ask to move Ego close to 79, 165. We change that to 85, 165, which is +// possible and prevents the freeze. Fixes bug #3585189. +// +// TODO: Our pathfinding algorithm stops Ego one step further away from the +// crusher than where SSCI is placing him. Since this is an edge case, and since +// it also happens in SSCI, it is easier to just patch the target coordinates. +// However, we should investigate our movement related functions. In this case, +// kInitBresen, kDoBresen, kGetAngle and kGetDistance are called, among others. +// kAvoidPath is not used in this case. +const byte qfg1vgaSignatureMoveToCrusher[] = { + 9, + 0x51, 0x1f, // class Motion + 0x36, // push + 0x39, 0x4f, // pushi 4f (79 - x) + 0x38, 0xa5, 0x00, // pushi 00a5 (165 - y) + 0x7c, // pushSelf + 0 +}; + +const uint16 qfg1vgaPatchMoveToCrusher[] = { + PATCH_ADDTOOFFSET | +3, + 0x39, 0x55, // pushi 55 (85 - x) + PATCH_END +}; + // script, description, magic DWORD, adjust const SciScriptSignature qfg1vgaSignatures[] = { { 215, "fight event issue", 1, PATCH_MAGICDWORD(0x6d, 0x76, 0x51, 0x07), -1, qfg1vgaSignatureFightEvents, qfg1vgaPatchFightEvents }, { 216, "weapon master event issue", 1, PATCH_MAGICDWORD(0x6d, 0x76, 0x51, 0x07), -1, qfg1vgaSignatureFightEvents, qfg1vgaPatchFightEvents }, { 814, "window text temp space", 1, PATCH_MAGICDWORD(0x3f, 0xba, 0x87, 0x00), 0, qfg1vgaSignatureTempSpace, qfg1vgaPatchTempSpace }, { 814, "dialog header offset", 3, PATCH_MAGICDWORD(0x5b, 0x04, 0x80, 0x36), 0, qfg1vgaSignatureDialogHeader, qfg1vgaPatchDialogHeader }, + { 331, "moving to crusher", 1, PATCH_MAGICDWORD(0x51, 0x1f, 0x36, 0x39), 0, qfg1vgaSignatureMoveToCrusher, qfg1vgaPatchMoveToCrusher }, SCI_SIGNATUREENTRY_TERMINATOR }; |