From 66f7df70fb03d487ae0c667adec3d5ad6e11721e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 23 Jul 2013 12:59:18 +0300 Subject: Add new sprite actions for water and sky. New actions: fly, swim, standsky, standwater, sitsky, sitwater, attacksky, attackwater, spawnsky, spawnwater, deadsky, deadwater For now attacksky and attackwater unused. --- src/map.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/map.cpp') 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); -- cgit v1.2.3-70-g09d2