[Scummvm-cvs-logs] CVS: scummvm/scumm script_v5.cpp,1.115,1.116 script_v6.cpp,1.157,1.158

Max Horn fingolfin at users.sourceforge.net
Wed Jun 11 14:46:17 CEST 2003


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

Modified Files:
	script_v5.cpp script_v6.cpp 
Log Message:
some walk fixes

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- script_v5.cpp	7 Jun 2003 18:26:51 -0000	1.115
+++ script_v5.cpp	11 Jun 2003 21:45:47 -0000	1.116
@@ -2372,7 +2372,7 @@
 }
 
 void Scumm_v5::o5_walkActorToActor() {
-	int x;
+	int x, y;
 	Actor *a, *a2;
 	int nr = getVarOrDirectByte(0x80);
 	int nr2 = getVarOrDirectByte(0x40);
@@ -2403,16 +2403,22 @@
 	if (_version <= 2)
 		dist *= 8;
 	else if (dist == 0xFF) {
-		dist = a2->scalex * a->width / 0xFF;
+		dist = a2->scalex * a2->width / 0xFF;
 		dist += dist / 2;
 	}
 	x = a2->x;
+	y = a2->y;
 	if (x < a->x)
 		x += dist;
 	else
 		x -= dist;
-	
-	a->startWalkActor(x, a2->y, -1);
+
+	if (_version <= 3) {
+		AdjustBoxResult abr = a->adjustXYToBeInBox(x, y);
+		x = abr.x;
+		y = abr.y;
+	}
+	a->startWalkActor(x, y, -1);
 }
 
 void Scumm_v5::o5_walkActorToObject() {

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -d -r1.157 -r1.158
--- script_v6.cpp	7 Jun 2003 00:49:36 -0000	1.157
+++ script_v6.cpp	11 Jun 2003 21:45:47 -0000	1.158
@@ -989,7 +989,7 @@
 void Scumm_v6::o6_walkActorToObj() {
 	int act, obj, dist;
 	Actor *a, *a2;
-	int x;
+	int x, y;
 
 	dist = pop();
 	obj = pop();
@@ -999,7 +999,7 @@
 	if (obj >= _numActors) {
 		if (whereIsObject(obj) == WIO_NOT_FOUND)
 			return;
-		int y, dir;
+		int dir;
 		getObjectXYPos(obj, x, y, dir);
 		a->startWalkActor(x, y, dir);
 	} else {
@@ -1015,14 +1015,15 @@
 			return;
 		if (dist == 0) {
 			dist = a2->scalex * a2->width / 0xFF;
-			dist += dist >> 1;
+			dist += dist / 2;
 		}
 		x = a2->x;
+		y = a2->y;
 		if (x < a->x)
 			x += dist;
 		else
 			x -= dist;
-		a->startWalkActor(x, a2->y, -1);
+		a->startWalkActor(x, y, -1);
 	}
 }
 





More information about the Scummvm-git-logs mailing list