diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-03-13 07:29:01 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-03-13 07:29:01 +0000 |
commit | efe4ef65bedbaa66e35f3a4354f7422c313ce624 (patch) | |
tree | c1259e6a60e80ee5b8ba97c44f9223071aba4df7 /src/game-server/movingobject.hpp | |
parent | 344fe375ff6e7db425da6ca266e02ea93dd7cc4d (diff) | |
download | manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.tar.gz manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.tar.bz2 manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.tar.xz manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.zip |
Implemented dynamic and selective pathblocking. Monsters are blocked by player characters and other monsters, player characters only by monsters.
Diffstat (limited to 'src/game-server/movingobject.hpp')
-rw-r--r-- | src/game-server/movingobject.hpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/game-server/movingobject.hpp b/src/game-server/movingobject.hpp index abad313a..a81212bb 100644 --- a/src/game-server/movingobject.hpp +++ b/src/game-server/movingobject.hpp @@ -45,6 +45,14 @@ class MovingObject : public Object mDirection(0) {} + virtual ~MovingObject() {}; + + /** + * Updates the walkmap of the map the object is on before + * calling Object::setPosition + */ + virtual void setPosition(const Point &p); + /** * Gets the destination coordinates of the object. */ @@ -128,6 +136,17 @@ class MovingObject : public Object void setPublicID(int id) { mPublicID = id; } + /** + * Gets the way the object blocks pathfinding for other objects + */ + virtual unsigned char getWalkMask() const + { return 0x00; } //can walk through everything + + /** + * Sets the map this thing is located on. + */ + virtual void setMap(MapComposite *map); + private: /** Object ID sent to clients (unique with respect to the map). */ unsigned short mPublicID; @@ -141,6 +160,12 @@ class MovingObject : public Object unsigned short mActionTime; /**< Delay until next action. */ unsigned char mDirection; /**< Facing direction. */ unsigned char mSize; /**< Radius of bounding circle. */ + + /** + * Gets the way the object blocks pathfinding for other objects + */ + virtual Map::BlockType getBlockType() const + { return Map::BLOCKTYPE_NONE; } }; #endif // _TMWSERV_MOVINGOBJECT_H_ |