summaryrefslogtreecommitdiff
path: root/src/resources/db/avatardb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/db/avatardb.cpp')
-rw-r--r--src/resources/db/avatardb.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/resources/db/avatardb.cpp b/src/resources/db/avatardb.cpp
index 8ff58efc5..100803a2a 100644
--- a/src/resources/db/avatardb.cpp
+++ b/src/resources/db/avatardb.cpp
@@ -43,20 +43,32 @@ void AvatarDB::load()
{
if (mLoaded)
unload();
+ loadXmlFile(paths.getStringValue("avatarsFile"));
+}
- XML::Document doc(paths.getStringValue("avatarsFile"));
+void AvatarDB::loadXmlFile(const std::string &fileName)
+{
+ XML::Document doc(fileName);
const XmlNodePtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "avatars"))
{
logger->log("Avatars Database: Error while loading %s!",
- paths.getStringValue("avatarsFile").c_str());
+ fileName.c_str());
mLoaded = true;
return;
}
for_each_xml_child_node(avatarNode, rootNode)
{
+ if (xmlNameEqual(avatarNode, "include"))
+ {
+ const std::string name = XML::getProperty(avatarNode, "name", "");
+ if (!name.empty())
+ loadXmlFile(name);
+ continue;
+ }
+
if (!xmlNameEqual(avatarNode, "avatar"))
continue;