diff options
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp index aa28a8160..d69375cf4 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -701,6 +701,16 @@ bool Map::getWalk(const int x, const int y, const unsigned char walkmask) const return !(mMetaTiles[x + y * mWidth].blockmask & walkmask); } +unsigned char Map::getBlockMask(const int x, const int y) +{ + // You can't walk outside of the map + if (x < 0 || y < 0 || x >= mWidth || y >= mHeight) + return 0; + + // Check if the tile is walkable + return mMetaTiles[x + y * mWidth].blockmask; +} + void Map::setWalk(const int x, const int y, const bool walkable A_UNUSED) { blockTile(x, y, Map::BLOCKTYPE_GROUNDTOP); |