diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-05-12 00:18:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-05-12 00:51:22 +0300 |
commit | d5a00a320043f5782ebc489285c89943b667e094 (patch) | |
tree | eb64f3b1f81f7ba2a3c7ff9e02ad329ef21abb83 /src/resources/db/mapdb.cpp | |
parent | 742b2a22bdcb69e6f615a284065ba2696e7bc261 (diff) | |
download | plus-d5a00a320043f5782ebc489285c89943b667e094.tar.gz plus-d5a00a320043f5782ebc489285c89943b667e094.tar.bz2 plus-d5a00a320043f5782ebc489285c89943b667e094.tar.xz plus-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.cpp | 24 |
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; } } |