summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/npc.h13
2 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 33ba3285..24c32e70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
* src/map.cpp: Fixed a crash caused by the new blocking system.
* data/new_1-1.tmx: Fixed warp to map 15 (patch by peavey).
+ * src/npc.hpp: Added pathblocking rules for NPCs.
2008-03-13 Philipp Sehmisch <tmw@crushnet.org>
diff --git a/src/npc.h b/src/npc.h
index 90570b36..17ebd537 100644
--- a/src/npc.h
+++ b/src/npc.h
@@ -45,6 +45,19 @@ class NPC : public Being
void buy();
void sell();
+
+ /**
+ * Gets the way an NPC is blocked by other things on the map
+ */
+ virtual unsigned char getWalkMask() const
+ { return 0x83; } // blocked like a monster by walls, monsters and characters ( bin 1000 0011)
+
+ protected:
+ /**
+ * Gets the way a monster blocks pathfinding for other objects
+ */
+ virtual Map::BlockType getBlockType() const
+ { return Map::BLOCKTYPE_CHARACTER; } //blocks like a player character
};
extern NPC *current_npc;