diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-01 21:35:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-01 22:40:36 +0300 |
commit | fc854786ed73fe768d6a3ca22c02f7013560a930 (patch) | |
tree | 3a12f555d194679957559760567ff8eb701b494b /src/map.cpp | |
parent | 09d74d9273cca445b7019edacaff53452a1eee3c (diff) | |
download | mv-fc854786ed73fe768d6a3ca22c02f7013560a930.tar.gz mv-fc854786ed73fe768d6a3ca22c02f7013560a930.tar.bz2 mv-fc854786ed73fe768d6a3ca22c02f7013560a930.tar.xz mv-fc854786ed73fe768d6a3ca22c02f7013560a930.zip |
Fix code style.
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/map.cpp b/src/map.cpp index 242162429..7fdb9a1bd 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -914,7 +914,7 @@ Path Map::findPath(int startX, int startY, int destX, int destY, // Skip if the tile is on the closed list or is not walkable // unless its the destination tile //+++ here need check block must depend on player abilities. - if (!newTile || newTile->whichList == mOnClosedList || + if (newTile->whichList == mOnClosedList || ((newTile->blockmask & walkmask) && !(x == destX && y == destY)) || (newTile->blockmask & BLOCKMASK_WALL)) @@ -931,11 +931,8 @@ Path Map::findPath(int startX, int startY, int destX, int destY, MetaTile *t2 = &mMetaTiles[curr.x + dx + curWidth]; //+++ here need check block must depend on player abilities. - if (!t1 || !t2 || ((t1->blockmask | t2->blockmask) - & BLOCKMASK_WALL)) - { + if (((t1->blockmask | t2->blockmask) & BLOCKMASK_WALL)) continue; - } } // Calculate G cost for this route, ~sqrt(2) for moving diagonal |