[Scummvm-git-logs] scummvm master -> f4ae043d70d17f13922fb3e2314b46f2ce80f038

bluegr bluegr at gmail.com
Wed Oct 24 17:47:31 CEST 2018


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:
f4ae043d70 SCI32: Fix an array initialization in the floppy version of QFG4


Commit: f4ae043d70d17f13922fb3e2314b46f2ce80f038
    https://github.com/scummvm/scummvm/commit/f4ae043d70d17f13922fb3e2314b46f2ce80f038
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-10-24T18:46:56+03:00

Commit Message:
SCI32: Fix an array initialization in the floppy version of QFG4

The array used for the trap machine's messages outside Dr. Cranium's
lab is set correctly now. Fixes bug #10766.

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


diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index 330b78b..e103a13 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -818,7 +818,22 @@ reg_t kArray(EngineState *s, int argc, reg_t *argv) {
 
 reg_t kArrayNew(EngineState *s, int argc, reg_t *argv) {
 	uint16 size = argv[0].toUint16();
-	const SciArrayType type = (SciArrayType)argv[1].toUint16();
+	SciArrayType type = (SciArrayType)argv[1].toUint16();
+
+	// WORKAROUND: QFG4 floppy has a different Array class in script 64920 than
+	// the CD version. Script 380 (the trap machine outside of Dr. Cranium's
+	// lab) creates 3 integer arrays, and the largest one is used to hold
+	// messages from the machine. In the CD version, the type of that array is
+	// correctly changed to 2 (a byte array), but in the floppy version, the type
+	// remains 0 (an array of 16-bit integers) inside the Array class.
+	// I haven't found a reliable way to patch the array creation in the game
+	// scripts, so we set the large array in the floppy version to be initialized
+	// with the same parameters as in the same way as in the CD version. This
+	// fixes the trap machine's messages in the floppy version.
+	if (g_sci->getGameId() == GID_QFG4 && !g_sci->isCD() && s->currentRoomNumber() == 380 && size == 128 && type == kArrayTypeInt16) {
+		size = 256;
+		type = kArrayTypeByte;
+	}
 
 	if (type == kArrayTypeString) {
 		++size;





More information about the Scummvm-git-logs mailing list