From 8480ff2ce8ac1ce1ceba024eddfaeb62a5d20f8d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 5 Aug 2014 16:07:44 +0300 Subject: Rename walkMask into blockWalkMask. --- src/resources/map/map.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/resources/map/map.cpp') diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp index f7f4b900f..694c6f934 100644 --- a/src/resources/map/map.cpp +++ b/src/resources/map/map.cpp @@ -672,14 +672,15 @@ void Map::blockTile(const int x, const int y, } } -bool Map::getWalk(const int x, const int y, const unsigned char walkmask) const +bool Map::getWalk(const int x, const int y, + const unsigned char blockWalkMask) const { // You can't walk outside of the map if (x < 0 || y < 0 || x >= mWidth || y >= mHeight) return false; // Check if the tile is walkable - return !(mMetaTiles[x + y * mWidth].blockmask & walkmask); + return !(mMetaTiles[x + y * mWidth].blockmask & blockWalkMask); } unsigned char Map::getBlockMask(const int x, const int y) const @@ -742,7 +743,8 @@ const std::string Map::getFilename() const Path Map::findPath(const int startX, const int startY, const int destX, const int destY, - const unsigned char walkmask, const int maxCost) + const unsigned char blockWalkMask, + const int maxCost) { BLOCK_START("Map::findPath") // The basic walking cost of a tile. @@ -760,7 +762,7 @@ Path Map::findPath(const int startX, const int startY, } // Return when destination not walkable - if (!getWalk(destX, destY, walkmask)) + if (!getWalk(destX, destY, blockWalkMask)) { BLOCK_END("Map::findPath") return path; @@ -830,7 +832,7 @@ Path Map::findPath(const int startX, const int startY, // unless its the destination tile // +++ here need check block must depend on player abilities. if (newTile->whichList == mOnClosedList || - ((newTile->blockmask & walkmask) + ((newTile->blockmask & blockWalkMask) && !(x == destX && y == destY)) || (newTile->blockmask & BlockMask::WALL)) { -- cgit v1.2.3-60-g2f50