summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-23 23:41:56 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-23 23:41:56 +0300
commitd1d8b4e1c28911c551ef7331fd76085d5d62fe6a (patch)
treea23a2a0494898d8788b29fa68d19bbfb30b992bb /src
parent63c072892b781d7661c505853ef8775eec593c7c (diff)
downloadplus-d1d8b4e1c28911c551ef7331fd76085d5d62fe6a.tar.gz
plus-d1d8b4e1c28911c551ef7331fd76085d5d62fe6a.tar.bz2
plus-d1d8b4e1c28911c551ef7331fd76085d5d62fe6a.tar.xz
plus-d1d8b4e1c28911c551ef7331fd76085d5d62fe6a.zip
In map remap db add patch and split files loading.
New options in paths.xml: mapsRemapPatchFile - patch file name for remap db. mapsRemapPatchDir - dir with patch files.
Diffstat (limited to 'src')
-rw-r--r--src/defaults.cpp2
-rw-r--r--src/resources/db/mapdb.cpp10
-rw-r--r--src/resources/db/mapdb.h2
3 files changed, 9 insertions, 5 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 290ee99ba..caaf69774 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -555,6 +555,8 @@ DefaultsData* getPathsDefaults()
AddDEF("monstersPatchFile", "monsters_patch.xml");
AddDEF("monstersPatchDir", "monsters.d");
AddDEF("mapsRemapFile", "maps/remap.xml");
+ AddDEF("mapsRemapPatchFile", "maps/remap_patch.xml");
+ AddDEF("mapsRemapPatchDir", "maps/remap.d");
AddDEF("mapsFile", "maps.xml");
AddDEF("mapsPatchFile", "maps_patch.xml");
AddDEF("mapsPatchDir", "maps.d");
diff --git a/src/resources/db/mapdb.cpp b/src/resources/db/mapdb.cpp
index 130e82fda..f0c9d988c 100644
--- a/src/resources/db/mapdb.cpp
+++ b/src/resources/db/mapdb.cpp
@@ -47,17 +47,19 @@ void MapDB::load()
if (mLoaded)
unload();
- loadRemap();
+ loadRemapXmlFile(paths.getStringValue("mapsRemapFile"));
+ loadRemapXmlFile(paths.getStringValue("mapsRemapPatchFile"));
+ loadXmlDir("mapsRemapPatchDir", loadRemapXmlFile);
+
loadInfo(paths.getStringValue("mapsFile"));
loadInfo(paths.getStringValue("mapsPatchFile"));
loadXmlDir("mapsPatchDir", loadInfo);
mLoaded = true;
}
-void MapDB::loadRemap()
+void MapDB::loadRemapXmlFile(const std::string &fileName)
{
- XML::Document *const doc = new XML::Document(
- paths.getStringValue("mapsRemapFile"));
+ XML::Document *const doc = new XML::Document(fileName);
const XmlNodePtrConst root = doc->rootNode();
if (!root)
diff --git a/src/resources/db/mapdb.h b/src/resources/db/mapdb.h
index a7629ba08..8e2bd6a2c 100644
--- a/src/resources/db/mapdb.h
+++ b/src/resources/db/mapdb.h
@@ -40,7 +40,7 @@ namespace MapDB
*/
void load();
- void loadRemap();
+ void loadRemapXmlFile(const std::string &fileName);
void loadInfo(const std::string &fileName);