From 3a54cf61c4ea127a16ca11c515906a5f419b97df Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 31 Jan 2013 15:36:56 +0300 Subject: Add default avatars support for npcs. --- src/resources/npcdb.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/resources/npcdb.cpp') diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index 07549eb03..f8e1e2340 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -95,6 +95,8 @@ void NPCDB::load() currentInfo->setDeadSortOffsetY(XML::getProperty(npcNode, "deadSortOffsetY", 31)); + currentInfo->setAvatarId(XML::getProperty(npcNode, "avatar", 0)); + SpriteDisplay display; for_each_xml_child_node(spriteNode, npcNode) { @@ -148,3 +150,11 @@ BeingInfo *NPCDB::get(const int id) return i->second; } } + +uint16_t NPCDB::getAvatarFor(const int id) +{ + BeingInfo *const info = get(id); + if (!info) + return 0; + return info->getAvatarId(); +} -- cgit v1.2.3-70-g09d2