[Scummvm-cvs-logs] scummvm master -> 90084cfdce0b64b0631cd5428c4c6fc97eb99090

Strangerke Strangerke at scummvm.org
Thu May 16 01:30:01 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
90084cfdce HOPKINS: Fix bug #3611942 and #3613072 - Pathfinding regression in 1fd81eee4056342971220240a49baef73737b386


Commit: 90084cfdce0b64b0631cd5428c4c6fc97eb99090
    https://github.com/scummvm/scummvm/commit/90084cfdce0b64b0631cd5428c4c6fc97eb99090
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-05-15T16:28:30-07:00

Commit Message:
HOPKINS: Fix bug #3611942 and #3613072 - Pathfinding regression in 1fd81eee4056342971220240a49baef73737b386

Changed paths:
    engines/hopkins/lines.cpp



diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp
index e6d5e5c..14320d5 100644
--- a/engines/hopkins/lines.cpp
+++ b/engines/hopkins/lines.cpp
@@ -945,46 +945,43 @@ int LinesManager::computeRouteIdx(int lineIdx, int dataIdx, int fromX, int fromY
 	if (destX >= minLineX && destX <= maxLineX && destY >= minLineY && destY <= maxLineY) {
 		int curY = destY;
 		int linesIdxUp = -1;
+		bool loopCond = false;
 		for (;;) {
 			--curY;
-			if (!checkCollisionLine(destX, curY, &foundDataIdx, &foundLineIdx, startLineIdx, endLineIdx))
-				break;
-
-			linesIdxUp = foundLineIdx;
-			if (!curY || minLineY > curY)
+			if (loopCond = checkCollisionLine(destX, curY, &foundDataIdx, &foundLineIdx, startLineIdx, endLineIdx))
+				linesIdxUp = foundLineIdx;
+			if (!curY || minLineY > curY || loopCond)
 				break;
 		}
 		curY = destY;
 		int lineIdxDown = -1;
+		loopCond = false;
 		for (;;) {
 			++curY;
-			if (!checkCollisionLine(destX, curY, &foundDataIdx, &foundLineIdx, startLineIdx, endLineIdx))
-				break;
-
-			lineIdxDown = foundLineIdx;
-			if (_vm->_globals->_characterMaxPosY <= curY || maxLineY <= curY)
+			if (loopCond = checkCollisionLine(destX, curY, &foundDataIdx, &foundLineIdx, startLineIdx, endLineIdx))
+				lineIdxDown = foundLineIdx;
+			if (_vm->_globals->_characterMaxPosY <= curY || maxLineY <= curY || loopCond)
 				break;
 		}
 		int curX = destX;
 		int lineIdxRight = -1;
+		loopCond = false;
 		for (;;) {
 			++curX;
-			if (!checkCollisionLine(curX, destY, &foundDataIdx, &foundLineIdx, startLineIdx, endLineIdx))
-				break;
-
-			lineIdxRight = foundLineIdx;
+			if (loopCond = checkCollisionLine(curX, destY, &foundDataIdx, &foundLineIdx, startLineIdx, endLineIdx))
+				lineIdxRight = foundLineIdx;
 
-			if (_vm->_graphicsMan->_maxX <= curX || maxLineX <= curX)
+			if (_vm->_graphicsMan->_maxX <= curX || maxLineX <= curX || loopCond)
 				break;
 		}
 		curX = destX;
 		int lineIdxLeft = -1;
+		loopCond = false;
 		for(;;) {
 			--curX;
-			if (!checkCollisionLine(curX, destY, &foundDataIdx, &foundLineIdx, startLineIdx, endLineIdx))
-				break;
-			lineIdxLeft = foundLineIdx;
-			if (curX <= 0 || minLineX >= curX)
+			if (loopCond = checkCollisionLine(curX, destY, &foundDataIdx, &foundLineIdx, startLineIdx, endLineIdx))
+				lineIdxLeft = foundLineIdx;
+			if (curX <= 0 || minLineX >= curX || loopCond)
 				break;
 		}
 		if (lineIdxRight != -1 && lineIdxLeft != -1 && linesIdxUp != -1 && lineIdxDown != -1) {






More information about the Scummvm-git-logs mailing list