diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-01-31 21:27:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-01-31 21:27:52 +0300 |
commit | 35481061f62111f916a39ce3cac6a314579418f9 (patch) | |
tree | ecf73b207a78f9e35bb47f8ed1067931733090b7 /src/resources/db/npcdb.cpp | |
parent | aea9e7f8c26644ba38db5eb9dbf412195f9851b2 (diff) | |
download | plus-35481061f62111f916a39ce3cac6a314579418f9.tar.gz plus-35481061f62111f916a39ce3cac6a314579418f9.tar.bz2 plus-35481061f62111f916a39ce3cac6a314579418f9.tar.xz plus-35481061f62111f916a39ce3cac6a314579418f9.zip |
Load currency names for each npc from npcs.xml.
Diffstat (limited to 'src/resources/db/npcdb.cpp')
-rw-r--r-- | src/resources/db/npcdb.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/resources/db/npcdb.cpp b/src/resources/db/npcdb.cpp index 55ca39c99..4e5fd35fe 100644 --- a/src/resources/db/npcdb.cpp +++ b/src/resources/db/npcdb.cpp @@ -27,6 +27,8 @@ #include "resources/beingcommon.h" #include "resources/beinginfo.h" +#include "resources/db/unitsdb.h" + #include "resources/sprite/spritereference.h" #include "utils/checkutils.h" @@ -115,6 +117,16 @@ void NPCDB::loadXmlFile(const std::string &fileName, currentInfo->setAllowDelete(XML::getBoolProperty(npcNode, "allowDelete", true)); + const std::string currency = XML::getProperty(npcNode, + "currency", "default"); + if (UnitsDb::existsCurrency(currency) == false) + { + reportAlways("Not found currency '%s' for npc %d", + currency.c_str(), + CAST_S32(id)); + } + currentInfo->setCurrency(currency); + SpriteDisplay display; for_each_xml_child_node(spriteNode, npcNode) { |