summaryrefslogtreecommitdiff
path: root/src/resources/db/mapdb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-12 00:18:57 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-12 00:51:22 +0300
commitd5a00a320043f5782ebc489285c89943b667e094 (patch)
treeeb64f3b1f81f7ba2a3c7ff9e02ad329ef21abb83 /src/resources/db/mapdb.cpp
parent742b2a22bdcb69e6f615a284065ba2696e7bc261 (diff)
downloadmanaplus-d5a00a320043f5782ebc489285c89943b667e094.tar.gz
manaplus-d5a00a320043f5782ebc489285c89943b667e094.tar.bz2
manaplus-d5a00a320043f5782ebc489285c89943b667e094.tar.xz
manaplus-d5a00a320043f5782ebc489285c89943b667e094.zip
Add skipError parameter to loadXml functions.
This allow not show errors for some not main xml files.
Diffstat (limited to 'src/resources/db/mapdb.cpp')
-rw-r--r--src/resources/db/mapdb.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/resources/db/mapdb.cpp b/src/resources/db/mapdb.cpp
index 6d31c69f2..5e9f31cfc 100644
--- a/src/resources/db/mapdb.cpp
+++ b/src/resources/db/mapdb.cpp
@@ -47,21 +47,24 @@ void MapDB::load()
if (mLoaded)
unload();
- loadRemapXmlFile(paths.getStringValue("mapsRemapFile"));
- loadRemapXmlFile(paths.getStringValue("mapsRemapPatchFile"));
+ loadRemapXmlFile(paths.getStringValue("mapsRemapFile"),
+ SkipError_true);
+ loadRemapXmlFile(paths.getStringValue("mapsRemapPatchFile"),
+ SkipError_true);
loadXmlDir("mapsRemapPatchDir", loadRemapXmlFile);
- loadInfo(paths.getStringValue("mapsFile"));
- loadInfo(paths.getStringValue("mapsPatchFile"));
+ loadInfo(paths.getStringValue("mapsFile"), SkipError_false);
+ loadInfo(paths.getStringValue("mapsPatchFile"), SkipError_true);
loadXmlDir("mapsPatchDir", loadInfo);
mLoaded = true;
}
-void MapDB::loadRemapXmlFile(const std::string &fileName)
+void MapDB::loadRemapXmlFile(const std::string &fileName,
+ const SkipError skipError)
{
XML::Document *const doc = new XML::Document(fileName,
UseResman_true,
- SkipError_false);
+ skipError);
const XmlNodePtrConst root = doc->rootNode();
if (!root)
@@ -88,7 +91,7 @@ void MapDB::loadRemapXmlFile(const std::string &fileName)
{
const std::string name = XML::getProperty(node, "name", "");
if (!name.empty())
- loadRemapXmlFile(name);
+ loadRemapXmlFile(name, skipError);
continue;
}
}
@@ -144,11 +147,12 @@ void MapDB::readAtlas(XmlNodePtrConst node)
}
}
-void MapDB::loadInfo(const std::string &fileName)
+void MapDB::loadInfo(const std::string &fileName,
+ const SkipError skipError)
{
XML::Document *doc = new XML::Document(fileName,
UseResman_true,
- SkipError_false);
+ skipError);
const XmlNodePtrConst root = doc->rootNode();
if (!root)
{
@@ -170,7 +174,7 @@ void MapDB::loadInfo(const std::string &fileName)
{
const std::string name = XML::getProperty(node, "name", "");
if (!name.empty())
- loadInfo(name);
+ loadInfo(name, skipError);
continue;
}
}