aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/kyra/scene_v2.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp
index 7072cfc9a5..3bf81bfb39 100644
--- a/engines/kyra/scene_v2.cpp
+++ b/engines/kyra/scene_v2.cpp
@@ -98,7 +98,7 @@ int KyraEngine_v2::findWay(int x, int y, int toX, int toY, int *moveTable, int m
temp = pathfinderInitPositionIndexTable(temp, x, y);
pathfinderFinializePath(moveTable, temp, x, y, moveTableSize);
usePostProcess = false;
- }
+ }
return usePostProcess ? size : getMoveTableSize(moveTable);
}
@@ -106,13 +106,14 @@ bool KyraEngine_v2::directLinePassable(int x, int y, int toX, int toY) {
debugC(9, kDebugLevelMain, "KyraEngine_v2::directLinePassable(%d, %d, %d, %d)", x, y, toX, toY);
Screen *scr = screen();
- while (x != toX && y != toY) {
+ while (x != toX || y != toY) {
int facing = getFacingFromPointToPoint(x, y, toX, toY);
x += _addXPosTable[facing];
y += _addYPosTable[facing];
if (!scr->getShapeFlag1(x, y))
return false;
}
+
return true;
}