diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-05 16:07:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-05 16:07:44 +0300 |
commit | 8480ff2ce8ac1ce1ceba024eddfaeb62a5d20f8d (patch) | |
tree | 5cc8d0097ce680cca550216e2313d1d1cb550cfc /src/resources/map/map.cpp | |
parent | 3aaf10f021303dd67a2c36bf23f380348b5bdf02 (diff) | |
download | mv-8480ff2ce8ac1ce1ceba024eddfaeb62a5d20f8d.tar.gz mv-8480ff2ce8ac1ce1ceba024eddfaeb62a5d20f8d.tar.bz2 mv-8480ff2ce8ac1ce1ceba024eddfaeb62a5d20f8d.tar.xz mv-8480ff2ce8ac1ce1ceba024eddfaeb62a5d20f8d.zip |
Rename walkMask into blockWalkMask.
Diffstat (limited to 'src/resources/map/map.cpp')
-rw-r--r-- | src/resources/map/map.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
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)) { |