[Scummvm-cvs-logs] CVS: scummvm/scumm script_v5.cpp,1.96,1.97

Max Horn fingolfin at users.sourceforge.net
Thu May 22 17:53:08 CEST 2003


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

Modified Files:
	script_v5.cpp 
Log Message:
o5_walkActorToActor cleanup, and fixed for V2

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- script_v5.cpp	23 May 2003 00:22:41 -0000	1.96
+++ script_v5.cpp	23 May 2003 00:52:31 -0000	1.97
@@ -2353,53 +2353,45 @@
 }
 
 void Scumm_v5::o5_walkActorToActor() {
-	int b, x, y;
+	int x;
 	Actor *a, *a2;
-	int nr;
-	int nr2 = getVarOrDirectByte(0x80);
-	a = derefActorSafe(nr2, "o5_walkActorToActor");
-	assert(a);
-
-	if (!a->isInCurrentRoom()) {
-		getVarOrDirectByte(0x40);
-		fetchScriptByte();
-		return;
-	}
+	int nr = getVarOrDirectByte(0x80);
+	int nr2 = getVarOrDirectByte(0x40);
+	int dist = fetchScriptByte();
 
-	nr = getVarOrDirectByte(0x40);
 	if (nr == 106 && _gameId == GID_INDY4) {
 		warning("Bypassing Indy4 bug");
-		fetchScriptByte();
 		return;
 	}
-	// warning("walk actor %d to actor %d", nr, nr2);
-	a2 = derefActorSafe(nr, "o5_walkActorToActor(2)");
-	assert(a2);
 
-	if (!a2->isInCurrentRoom()) {
-		fetchScriptByte();
+	a = derefActorSafe(nr, "o5_walkActorToActor");
+	assert(a);
+	if (!a->isInCurrentRoom())
 		return;
-	}
-	b = fetchScriptByte();				/* distance from actor */
-	if (b == 0xFF) {
-		b = a2->scalex * a->width / 0xFF;
-		b = b + b / 2;
+
+	a2 = derefActorSafe(nr2, "o5_walkActorToActor(2)");
+	assert(a2);
+	if (!a2->isInCurrentRoom())
+		return;
+
+	if (_features & GF_AFTER_V2)
+		dist *= 8;
+	else if (dist == 0xFF) {
+		dist = a2->scalex * a->width / 0xFF;
+		dist += dist / 2;
 	}
 	x = a2->x;
-	y = a2->y;
 	if (x < a->x)
-		x += b;
+		x += dist;
 	else
-		x -= b;
-
-	a->startWalkActor(x, y, -1);
+		x -= dist;
+	
+	a->startWalkActor(x, a2->y, -1);
 }
 
 void Scumm_v5::o5_walkActorToObject() {
 	int obj;
 	Actor *a;
-
-	// warning("walk object to object");
 
 	a = derefActorSafe(getVarOrDirectByte(0x80), "o5_walkActorToObject");
 	obj = getVarOrDirectWord(0x40);





More information about the Scummvm-git-logs mailing list