From fc854786ed73fe768d6a3ca22c02f7013560a930 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 1 Aug 2012 21:35:49 +0300 Subject: Fix code style. --- src/map.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/map.cpp') 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 -- cgit v1.2.3-70-g09d2