summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-09 23:02:28 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-09 23:02:28 +0300
commit94a9a81d9c6aa9fa287616c8b4bfc5ea86214dcd (patch)
treea5fd9ec3c5844ce9b8d6b4c63c25c9ded803a6a0 /src/map.cpp
parent51169702a6fba4626eeae44faa35ebcbf40e5fed (diff)
downloadplus-94a9a81d9c6aa9fa287616c8b4bfc5ea86214dcd.tar.gz
plus-94a9a81d9c6aa9fa287616c8b4bfc5ea86214dcd.tar.bz2
plus-94a9a81d9c6aa9fa287616c8b4bfc5ea86214dcd.tar.xz
plus-94a9a81d9c6aa9fa287616c8b4bfc5ea86214dcd.zip
Impliment air and water block types.
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 8d2031019..83143a7c8 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -793,6 +793,12 @@ void Map::blockTile(int x, int y, BlockType type)
case BLOCKTYPE_MONSTER:
mMetaTiles[tileNum].blockmask |= BLOCKMASK_MONSTER;
break;
+ case BLOCKTYPE_AIR:
+ mMetaTiles[tileNum].blockmask |= BLOCKMASK_AIR;
+ break;
+ case BLOCKTYPE_WATER:
+ mMetaTiles[tileNum].blockmask |= BLOCKMASK_WATER;
+ break;
default:
case BLOCKTYPE_NONE:
case NB_BLOCKTYPES:
@@ -1053,6 +1059,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 ||
((newTile->blockmask & walkmask)
&& !(x == destX && y == destY))
@@ -1068,6 +1075,7 @@ Path Map::findPath(int startX, int startY, int destX, int destY,
MetaTile *t1 = getMetaTile(curr.x, curr.y + dy);
MetaTile *t2 = getMetaTile(curr.x + dx, curr.y);
+ //+++ here need check block must depend on player abilities.
if (!t1 || !t2 || ((t1->blockmask | t2->blockmask)
& BLOCKMASK_WALL))
{