summaryrefslogtreecommitdiff
path: root/src/resources/npcdb.cpp
diff options
context:
space:
mode:
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();
+}