From 27892bc40122494385bdbe5eb84aee52737f9c13 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 9 Feb 2017 20:26:32 -0500 Subject: skirl; angry --- src/world.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/world.cpp') diff --git a/src/world.cpp b/src/world.cpp index 4f2f99c..8db9344 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -203,20 +203,25 @@ void WorldSystem::load(const std::string& file) UserError("XML Error: Failed to parse file (not your fault though..?)"); // include headers + std::vector toAdd; auto ixml = xmlDoc.FirstChildElement("include"); while (ixml != nullptr) { auto file = ixml->Attribute("file"); if (file != nullptr) { DEBUG_printf("Including file: %s\n", file); - xmlRaw.append(readFile(xmlFolder + file)); + toAdd.emplace_back(xmlFolder + file); + //xmlRaw.append(readFile(xmlFolder + file)); } else { UserError("XML Error: tag file not given"); } - break;//ixml = ixml->NextSiblingElement(); + ixml = ixml->NextSiblingElement("include"); } + for (const auto& f : toAdd) + xmlRaw.append(readFile(f)); + if (xmlDoc.Parse(xmlRaw.data()) != XML_NO_ERROR) UserError("XML Error:"); @@ -385,6 +390,8 @@ void WorldSystem::load(const std::string& file) entity.assign(); } else if (tname == "Hop" ) { entity.assign(); + } else if (tname == "Aggro" ) { + entity.assign(abcd->Attribute("arena")); } else if (tname == "Animation") { auto entan = entity.assign(); auto animx = abcd->FirstChildElement(); -- cgit v1.2.3