From efe4ef65bedbaa66e35f3a4354f7422c313ce624 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Thu, 13 Mar 2008 07:29:01 +0000 Subject: Implemented dynamic and selective pathblocking. Monsters are blocked by player characters and other monsters, player characters only by monsters. --- src/game-server/character.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/game-server/character.hpp') diff --git a/src/game-server/character.hpp b/src/game-server/character.hpp index b90d2b3c..62bec49d 100644 --- a/src/game-server/character.hpp +++ b/src/game-server/character.hpp @@ -50,6 +50,8 @@ class Character : public Being */ Character(MessageIn &msg); + ~Character(); + /** * recalculates the level when necessary and calls Being::update */ @@ -271,6 +273,12 @@ class Character : public Being int getCorrectionPoints() const { return mCorrectionPoints; } + /** + * Gets the way the object is blocked by other things on the map + */ + virtual unsigned char getWalkMask() const + { return 0x82; } // blocked by walls and monsters ( bin 1000 0010) + private: Character(Character const &); Character &operator=(Character const &); @@ -340,6 +348,13 @@ class Character : public Being bool mRecalculateLevel; /**< flag raised when the character level might have increased */ unsigned char mAccountLevel; /**< Account level of the user. */ TransactionType mTransaction; /**< Trade/buy/sell action the character is involved in. */ + + protected: + /** + * Gets the way the object blocks pathfinding for other objects + */ + virtual Map::BlockType getBlockType() const + { return Map::BLOCKTYPE_CHARACTER; } }; #endif // _TMWSERV_CHARACTER_HPP_ -- cgit v1.2.3-70-g09d2