[Scummvm-cvs-logs] scummvm master -> 2a37ed395c4090b531137722e65b74157f814a95

bluegr md5 at scummvm.org
Fri Mar 11 17:08:23 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2a37ed395c SCI: Fixed bug #3034714 - "KQ5CD: ScummVM freezes in dark forest"


Commit: 2a37ed395c4090b531137722e65b74157f814a95
    https://github.com/scummvm/scummvm/commit/2a37ed395c4090b531137722e65b74157f814a95
Author: md5 (md5 at scummvm.org)
Date: 2011-03-11T08:06:30-08:00

Commit Message:
SCI: Fixed bug #3034714 - "KQ5CD: ScummVM freezes in dark forest"

This is a heap patch for an odd object used in that scene, which will
suffice for now (until we find why this works in SSCI). Thanks to wjp
for his help and work on this

Changed paths:
    engines/sci/engine/script_patches.cpp



diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 8c622b1..17362cc 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -498,9 +498,46 @@ const uint16 kq5PatchCdHarpyVolume[] = {
 	PATCH_END
 };
 
+// This is a heap patch, and it modifies the properties of an object, instead
+// of patching script code.
+// The witchCage object in script 200 is different than other objects, as it
+// has 4 properties for its bounding box (top, left, bottom, right), but it
+// initializes 4 extra ones before them to 0. The fact that this object's
+// bounding box is invalid confuses the game scripts and makes the game enter
+// an endless loop, as the scripts are trying to see if the witch can be inside
+// an empty rectangle (which will never be true). The dimensions of the actual
+// bounding box can be observed from the values of these invalid parameters.
+// This object is also invalid in SV, so there must be special code to treat
+// such situations. The following heap patch sets the first four valid object
+// properties (which are what the game scripts refer to) to their valid values,
+// equal to the values of the subsequent four invalid values. We don't know why
+// or how this worked in SSCI, but this simple patch fixes this situation.
+// Fixes bug #3034714.
+const byte kq5SignatureWitchCageInit[] = {
+	16,
+	0x00, 0x00,	// top
+	0x00, 0x00,	// left
+	0x00, 0x00,	// bottom
+	0x00, 0x00,	// right
+	0x00, 0x00,	// extra property #1
+	0x7a, 0x00,	// extra property #2
+	0xc8, 0x00,	// extra property #3
+	0xa3, 0x00,	// extra property #4
+	0
+};
+
+const uint16 kq5PatchWitchCageInit[] = {
+	0x00, 0x00,	// top
+	0x7a, 0x00,	// left
+	0xc8, 0x00,	// bottom
+	0xa3, 0x00,	// right
+	PATCH_END
+};
+
 //    script, description,                                      magic DWORD,                                 adjust
 const SciScriptSignature kq5Signatures[] = {
 	{      0, "CD: harpy volume change",                     1, PATCH_MAGICDWORD(0x80, 0x91, 0x01, 0x18),     0, kq5SignatureCdHarpyVolume, kq5PatchCdHarpyVolume },
+	{    200, "CD: witch cage init",                         1, PATCH_MAGICDWORD(0x7a, 0x00, 0xc8, 0x00),   -10, kq5SignatureWitchCageInit, kq5PatchWitchCageInit },
 	SCI_SIGNATUREENTRY_TERMINATOR
 };
 






More information about the Scummvm-git-logs mailing list