diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2007-06-30 15:01:50 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2007-06-30 15:01:50 +0000 |
commit | d7e84be1d3dc935f47cefc0f600ced74f37e46fb (patch) | |
tree | f535b6b4130994a9162c48f8c556b0dd5ddc9a5f /src/game-server/map.hpp | |
parent | fd392c16c0a1236ca4ea124b5ebbd309df1c5064 (diff) | |
download | manaserv-d7e84be1d3dc935f47cefc0f600ced74f37e46fb.tar.gz manaserv-d7e84be1d3dc935f47cefc0f600ced74f37e46fb.tar.bz2 manaserv-d7e84be1d3dc935f47cefc0f600ced74f37e46fb.tar.xz manaserv-d7e84be1d3dc935f47cefc0f600ced74f37e46fb.zip |
Implemented basic monster AI and fixed a stability problem caused by the spawn areas.
Diffstat (limited to 'src/game-server/map.hpp')
-rw-r--r-- | src/game-server/map.hpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/game-server/map.hpp b/src/game-server/map.hpp index a7c1fe2a..b0840b2c 100644 --- a/src/game-server/map.hpp +++ b/src/game-server/map.hpp @@ -57,7 +57,8 @@ class MetaTile int whichList; /**< No list, open list or closed list */ int parentX; /**< X coordinate of parent tile */ int parentY; /**< Y coordinate of parent tile */ - bool walkable; /**< Can beings walk on this tile */ + bool permWalkable; /**< Can beings normally walk on this tile */ + bool tempWalkable; /**< Can beings walk on this tile this tick? */ }; /** @@ -114,10 +115,22 @@ class Map getMetaTile(int x, int y); /** - * Set walkability flag for a tile + * Set permanent walkability flag for a tile */ void - setWalk(int x, int y, bool walkable); + setPermWalk(int x, int y, bool walkable); + + /** + * Set temporary walkability flag for a tile + */ + void + setTempWalk(int x, int y, bool walkable); + + /** + * Resets the temporary walkable status of all tiles to the permanent + * walkable status. + */ + void resetTempWalk(); /** * Tell if a tile is walkable or not, includes checking beings. @@ -159,8 +172,7 @@ class Map * Find a path from one location to the next. */ std::list<PATH_NODE> - findPath(int startX, int startY, - int destX, int destY); + findPath(int startX, int startY, int destX, int destY, int maxCost = 20); private: int width, height; |