[Scummvm-cvs-logs] SF.net SVN: scummvm: [29866] scummvm/trunk/engines/sword2/interpreter.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sun Dec 16 01:41:31 CET 2007


Revision: 29866
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29866&view=rev
Author:   eriktorbjorn
Date:     2007-12-15 16:41:30 -0800 (Sat, 15 Dec 2007)

Log Message:
-----------
Workaround for bug #1487382 ("SWORD2: Game freezes"). It appears to be a script
bug.

Modified Paths:
--------------
    scummvm/trunk/engines/sword2/interpreter.cpp

Modified: scummvm/trunk/engines/sword2/interpreter.cpp
===================================================================
--- scummvm/trunk/engines/sword2/interpreter.cpp	2007-12-15 22:54:00 UTC (rev 29865)
+++ scummvm/trunk/engines/sword2/interpreter.cpp	2007-12-16 00:41:30 UTC (rev 29866)
@@ -312,6 +312,7 @@
 	bool checkMopBug = false;
 	bool checkPyramidBug = false;
 	bool checkElevatorBug = false;
+	bool checkPearlBug = false;
 
 	if (scriptNumber == 2) {
 		if (strcmp((char *)header.name, "mop_73") == 0)
@@ -320,6 +321,8 @@
 			checkPyramidBug = true;
 		else if (strcmp((char *)header.name, "lift_82") == 0)
 			checkElevatorBug = true;
+		else if (strcmp((char *)header.name, "pearl_31") == 0)
+			checkPearlBug = true;
 	}
 
 	code += noScripts * 4;
@@ -633,6 +636,15 @@
 				// Continue as normal
 				break;
 			case IR_TERMINATE:
+				if (checkPearlBug && readVar(1290) == 0) {
+					// Pearl's interaction script will wait
+					// until global(1290) is no longer 0
+					// before doing anything. But if the
+					// script was terminated prematurely,
+					// that never happens.
+					warning("Working around Pearl bug: Resetting Pearl's state");
+					writeVar(1290, 1);
+				}
 				// Return without updating the offset
 				return 2;
 			case IR_REPEAT:


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list