[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.219,1.220

James Brown ender at users.sourceforge.net
Fri Jan 16 01:07:02 CET 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv12322/scumm

Modified Files:
	actor.cpp 
Log Message:
Hack for infinite loop in walkbox code - hacks around Maniac bug #862245 (fixes is a strong word for a breakout counter hack :)


Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.219
retrieving revision 1.220
diff -u -d -r1.219 -r1.220
--- actor.cpp	16 Jan 2004 01:52:49 -0000	1.219
+++ actor.cpp	16 Jan 2004 09:05:57 -0000	1.220
@@ -1477,7 +1477,7 @@
 
 void Actor::walkActorOld() {
 	Common::Point p2, p3;	// Gate locations
-	int new_dir, next_box;
+	int new_dir, next_box, loopCtr = 0;
 
 	if (!moving)
 		return;
@@ -1515,6 +1515,7 @@
 
 	moving &= ~MF_NEW_LEG;
 	do {
+		loopCtr++;
 
 		if (walkbox == kInvalidBox) {
 			setBox(walkdata.destbox);
@@ -1572,6 +1573,13 @@
 			setBox(walkdata.destbox);
 		else
 			setBox(walkdata.curbox);
+
+		// FIXME: Ender added this recursion counter as a hack around
+		//        a infinite loop in Maniac V1 - see bug #862245
+		if (loopCtr > 10000) {
+			moving |= MF_LAST_LEG;
+			return;
+		}
 	} while (1);
 
 	moving |= MF_LAST_LEG;





More information about the Scummvm-git-logs mailing list