summaryrefslogtreecommitdiff
path: root/src/resources/mapdb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-16 00:34:53 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-16 00:34:53 +0300
commitcf79b26f999ddd795a54b553af3fdb553ec04536 (patch)
tree8ebc6649f316d5b3021ad80f72b79e9f209366ad /src/resources/mapdb.cpp
parent665e33246a82838dc8893e6b84a576de803a3195 (diff)
downloadmv-cf79b26f999ddd795a54b553af3fdb553ec04536.tar.gz
mv-cf79b26f999ddd795a54b553af3fdb553ec04536.tar.bz2
mv-cf79b26f999ddd795a54b553af3fdb553ec04536.tar.xz
mv-cf79b26f999ddd795a54b553af3fdb553ec04536.zip
improve mapdb file.
Diffstat (limited to 'src/resources/mapdb.cpp')
-rw-r--r--src/resources/mapdb.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/resources/mapdb.cpp b/src/resources/mapdb.cpp
index 0efc07bf6..621387175 100644
--- a/src/resources/mapdb.cpp
+++ b/src/resources/mapdb.cpp
@@ -53,7 +53,7 @@ void MapDB::load()
void MapDB::loadRemap()
{
- XML::Document *doc = new XML::Document(
+ XML::Document *const doc = new XML::Document(
paths.getStringValue("maps").append("remap.xml"));
const XmlNodePtr root = doc->rootNode();
@@ -67,11 +67,11 @@ void MapDB::loadRemap()
{
if (xmlNameEqual(node, "map"))
{
- std::string name = XML::getProperty(node, "name", "");
+ const std::string name = XML::getProperty(node, "name", "");
if (name.empty())
continue;
- std::string value = XML::getProperty(node, "value", "");
+ const std::string value = XML::getProperty(node, "value", "");
if (value.empty())
continue;
@@ -145,7 +145,7 @@ void MapDB::unload()
mLoaded = false;
}
-std::string MapDB::getMapName(const std::string &name)
+const std::string MapDB::getMapName(const std::string &name)
{
const MapIterator it = mMaps.find(name);
@@ -154,13 +154,13 @@ std::string MapDB::getMapName(const std::string &name)
return name;
}
-MapDB::MapInfo *MapDB::getMapAtlas(const std::string &name)
+const MapDB::MapInfo *MapDB::getMapAtlas(const std::string &name)
{
- MapInfoIter it = mInfos.find(name);
+ const MapInfoIter it = mInfos.find(name);
if (it == mInfos.end())
return nullptr;
MapInfo *const info = &(*it).second;
- AtlasIter it2 = mAtlases.find(info->atlas);
+ const AtlasCIter it2 = mAtlases.find(info->atlas);
if (it2 == mAtlases.end())
return nullptr;
info->files = &((*it2).second);