summaryrefslogtreecommitdiff
path: root/src/resources/npcdb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-01-31 15:36:56 +0300
committerAndrei Karas <akaras@inbox.ru>2013-01-31 21:56:05 +0300
commit3a54cf61c4ea127a16ca11c515906a5f419b97df (patch)
tree7b330747d4357c95791f578eeda0356c8649e614 /src/resources/npcdb.cpp
parent741630d53aa385f192edb40ac27b00844285eac8 (diff)
downloadplus-3a54cf61c4ea127a16ca11c515906a5f419b97df.tar.gz
plus-3a54cf61c4ea127a16ca11c515906a5f419b97df.tar.bz2
plus-3a54cf61c4ea127a16ca11c515906a5f419b97df.tar.xz
plus-3a54cf61c4ea127a16ca11c515906a5f419b97df.zip
Add default avatars support for npcs.
Diffstat (limited to 'src/resources/npcdb.cpp')
-rw-r--r--src/resources/npcdb.cpp10
1 files changed, 10 insertions, 0 deletions
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();
+}