diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-03-23 22:06:33 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-03-24 19:08:09 +0100 |
commit | a3dc6e19b1cb7eec1dcbbcef5d370f4ab55a9ade (patch) | |
tree | 91b7bd840756eff88d59617054854d55bb5910d2 /src/game-server/mapmanager.cpp | |
parent | 94d97450bc3a52cd90baa696320bd08d91ac301f (diff) | |
download | manaserv-a3dc6e19b1cb7eec1dcbbcef5d370f4ab55a9ade.tar.gz manaserv-a3dc6e19b1cb7eec1dcbbcef5d370f4ab55a9ade.tar.bz2 manaserv-a3dc6e19b1cb7eec1dcbbcef5d370f4ab55a9ade.tar.xz manaserv-a3dc6e19b1cb7eec1dcbbcef5d370f4ab55a9ade.zip |
Rely more on the functionality in XML::Document
By default XML::Document will use the ResourceManager to resolve the
file name you pass to it. There is no point in disabling that
functionality only to resolve it manually.
Reviewed-by: Jared Adams
Diffstat (limited to 'src/game-server/mapmanager.cpp')
-rw-r--r-- | src/game-server/mapmanager.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/game-server/mapmanager.cpp b/src/game-server/mapmanager.cpp index fce5cc5a..094af923 100644 --- a/src/game-server/mapmanager.cpp +++ b/src/game-server/mapmanager.cpp @@ -44,23 +44,17 @@ int MapManager::initialize(const std::string &mapReferenceFile) // Indicates the number of maps loaded successfully int loadedMaps = 0; - std::string absPathFile = ResourceManager::resolve(mapReferenceFile); - if (absPathFile.empty()) { - LOG_ERROR("Map Manager: Could not find " << mapReferenceFile << "!"); - return loadedMaps; - } - - XML::Document doc(absPathFile, false); + XML::Document doc(mapReferenceFile); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "maps")) { LOG_ERROR("Item Manager: Error while parsing map database (" - << absPathFile << ")!"); + << mapReferenceFile << ")!"); return loadedMaps; } - LOG_INFO("Loading map reference: " << absPathFile); + LOG_INFO("Loading map reference: " << mapReferenceFile); for_each_xml_child_node(node, rootNode) { if (!xmlStrEqual(node->name, BAD_CAST "map")) |