[Scummvm-cvs-logs] CVS: scummvm/scumm script.cpp,1.11,1.12

James Brown ender at users.sourceforge.net
Fri Nov 8 10:07:01 CET 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv11098/scumm

Modified Files:
	script.cpp 
Log Message:
Fix Indy3 "Guard-Fighting" crash and properly fix the empty exits problem


Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- script.cpp	6 Nov 2002 16:44:57 -0000	1.11
+++ script.cpp	8 Nov 2002 18:06:08 -0000	1.12
@@ -640,10 +640,18 @@
 		// not actual data not even a 00 (stop code)
 		// maybe we should be limiting ourselves to strictly reading the size 
 		// described in the header?
-		if ((_currentRoom == 7) && (_gameId == GID_INDY3_256))
-			printf("skipping specific exit script as its empty, fix properly!\n");
-		else
-			runScriptNested(slot);
+		if (_gameId == GID_INDY3_256) {
+			// FIXME: Oddly, Indy3 seems to contain exit scripts with only a size
+			// and a tag - not even a terminating NULL!
+			byte *roomptr = getResourceAddress(rtRoom, _roomResource);
+			byte *excd = findResourceData(MKID('EXCD'), roomptr) - _resourceHeaderSize;
+			if (!excd || (getResourceDataSize(excd) < 1)) {
+				debug(2, "Exit-%d is empty", _roomResource);
+				return;
+			}
+		}
+
+		runScriptNested(slot);
 	}
 	if (_vars[VAR_EXIT_SCRIPT2])
 		runScript(_vars[VAR_EXIT_SCRIPT2], 0, 0, 0);





More information about the Scummvm-git-logs mailing list