[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.147,1.148

Andrew Kurushin h00ligan at users.sourceforge.net
Sun Jul 3 08:28:04 CEST 2005


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10727

Modified Files:
	actor.cpp 
Log Message:
fixed Elara bug

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -d -r1.147 -r1.148
--- actor.cpp	1 Jul 2005 17:29:22 -0000	1.147
+++ actor.cpp	3 Jul 2005 15:22:59 -0000	1.148
@@ -987,8 +987,7 @@
 					speed = 1;
 				}
 
-				if ((actor->actionDirection == kDirUp) || (actor->actionDirection == kDirDown)) {
-					// move by 2's in vertical dimension
+				if ((actor->actionDirection == kDirUp) || (actor->actionDirection == kDirDown)) {					
 					addDelta.y = clamp(-speed, delta.y, speed);
 					if (addDelta.y == delta.y) {
 						addDelta.x = delta.x;
@@ -1647,10 +1646,12 @@
 	} else {
 		
 		actor->location.toScreenPointXY(pointFrom);
+		pointFrom.x &= ~1;
 
 		extraStartNode = _vm->_scene->offscreenPath(pointFrom);
 
 		toLocation.toScreenPointXY(pointTo);
+		pointTo.x &= ~1;
 
 		extraEndNode = _vm->_scene->offscreenPath(pointTo);
 
@@ -1700,19 +1701,21 @@
 
 
 					anotherActorScreenPosition = anotherActor->screenPosition;
-					testBox.left = anotherActorScreenPosition.x - collision.x;
-					testBox.right = anotherActorScreenPosition.x + collision.x + 1;
+					testBox.left = (anotherActorScreenPosition.x - collision.x) & ~1;
+					testBox.right = (anotherActorScreenPosition.x + collision.x) & ~1 + 1;
 					testBox.top = anotherActorScreenPosition.y - collision.y;
 					testBox.bottom = anotherActorScreenPosition.y + collision.y + 1;
 					testBox2 = testBox;
-					testBox2.right += 1;
-					testBox2.left -= 1;
+					testBox2.right += 2;
+					testBox2.left -= 2;
+					testBox2.top -= 1;
+					testBox2.bottom += 1;
 
 					if (testBox2.contains(pointFrom)) {
 						if (pointFrom.x > anotherActorScreenPosition.x + 4) {
 							testBox.right = pointFrom.x - 1;
 						} else {
-							if (pointFrom.x < anotherActorScreenPosition.x - 4) {
+							if (pointFrom.x < anotherActorScreenPosition.x - 4) {	
 								testBox.left = pointFrom.x + 2;
 							} else {
 								if (pointFrom.y > anotherActorScreenPosition.y) {
@@ -1754,7 +1757,6 @@
 
 			pointBest = actor->walkStepsPoints[actor->walkStepsCount - 1];
 
-			pointFrom.x &= ~1;
 			delta.x = ABS(pointFrom.x - pointTo.x);
 			delta.y = ABS(pointFrom.y - pointTo.y);
 





More information about the Scummvm-git-logs mailing list