[Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.140,1.141

Max Horn fingolfin at users.sourceforge.net
Fri Sep 19 12:34:17 CEST 2003


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

Modified Files:
	object.cpp 
Log Message:
changed scumm/object.cpp for V1/V2 once again - this time it really should match the original behaviour

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -d -r1.140 -r1.141
--- object.cpp	14 Sep 2003 18:16:44 -0000	1.140
+++ object.cpp	19 Sep 2003 01:12:05 -0000	1.141
@@ -298,11 +298,17 @@
 	}
 
 	// Now compute the distance between the two points
-	dist = getDist(x, y, x2, y2);
-	// For V1/V2 games, distances are measured in "charactes" instead of pixels,
-	// so we divide by 8, rounding up.
-	if (_version <= 2)
-		dist = (dist + 7) / 8;
+	x = ABS(x - x2);
+	y = ABS(y - y2);
+
+	// For V1/V2 games, distances are measured in the original "character"
+	// based coordinate system, instead of pixels. Otherwise various scripts
+	// will break.
+	if (_version <= 2) {
+		dist = MAX(x/8, y/2);
+	} else 
+		dist = MAX(x, y);
+
 	return dist;
 }
 





More information about the Scummvm-git-logs mailing list