[Scummvm-cvs-logs] CVS: scummvm/scumm boxes.cpp,1.51,1.52

Max Horn fingolfin at users.sourceforge.net
Tue Jul 22 12:02:20 CEST 2003


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

Modified Files:
	boxes.cpp 
Log Message:
fix for bug #775420; also properly implemented the 'box matrix truncated' workaround

Index: boxes.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/boxes.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- boxes.cpp	21 Jul 2003 22:11:33 -0000	1.51
+++ boxes.cpp	22 Jul 2003 19:01:38 -0000	1.52
@@ -616,6 +616,7 @@
 	const byte *boxm;
 	byte i;
 	const int numOfBoxes = getNumBoxes();
+	int dest = -1;
 	
 	if (from == to)
 		return to;
@@ -662,7 +663,7 @@
 
 	// Skip up to the matrix data for box 'from'
 	for (i = 0; i < from && boxm < end; i++) {
-		while (*boxm != 0xFF)
+		while (boxm < end && *boxm != 0xFF)
 			boxm += 3;
 		boxm++;
 	}
@@ -670,14 +671,14 @@
 	// Now search for the entry for box 'to'
 	while (boxm < end && boxm[0] != 0xFF) {
 		if (boxm[0] <= to && to <= boxm[1])
-			return (int8)boxm[2];
+			dest = (int8)boxm[2];
 		boxm += 3;
 	}
 	
 	if (boxm >= end)
 		warning("The box matrix apparently is truncated (room %d)", _roomResource);
 
-	return -1;
+	return dest;
 }
 
 /*





More information about the Scummvm-git-logs mailing list