aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2008-05-19 23:04:52 +0000
committerJohannes Schickel2008-05-19 23:04:52 +0000
commit5b5e5bfc62ba459b2c58a5dba9cb64a2fc4c7c2f (patch)
tree3abf1cb91a91529f5460d5fed492c5726c33be7d /engines/kyra
parent815ca646e1eb81240cc36631238fb10d8dc95a4a (diff)
downloadscummvm-rg350-5b5e5bfc62ba459b2c58a5dba9cb64a2fc4c7c2f.tar.gz
scummvm-rg350-5b5e5bfc62ba459b2c58a5dba9cb64a2fc4c7c2f.tar.bz2
scummvm-rg350-5b5e5bfc62ba459b2c58a5dba9cb64a2fc4c7c2f.zip
Fixed bug in KyraEngine_v2::directLinePassable. This should fix some pathfinder issues in HoF and MR.
svn-id: r32190
Diffstat (limited to 'engines/kyra')
-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;
}