diff options
author | Blue Sans Douze <bluesansdouze@gmail.com> | 2010-01-23 17:31:21 +0100 |
---|---|---|
committer | Blue Sans Douze <bluesansdouze@gmail.com> | 2010-01-23 18:37:30 +0100 |
commit | 943166059f5e0b7403b00f5d5fc19bd72c706657 (patch) | |
tree | 4f05e25d6c4d2c30632938b9bdc29b24e0c46c18 /src/map.cpp | |
parent | 7fa3653824e7aacf15aa4fc14f2465addc831851 (diff) | |
download | mana-client-943166059f5e0b7403b00f5d5fc19bd72c706657.tar.gz mana-client-943166059f5e0b7403b00f5d5fc19bd72c706657.tar.bz2 mana-client-943166059f5e0b7403b00f5d5fc19bd72c706657.tar.xz mana-client-943166059f5e0b7403b00f5d5fc19bd72c706657.zip |
Autoload a minimap is no minimap info is given
Looks for "graphics/minimap/MAPID.png"
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp index 34064a64..5f411c47 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -583,6 +583,18 @@ const std::string &Map::getName() const return getProperty("mapname"); } +const std::string *Map::getMapId() const +{ + std::string fileName = getProperty("_filename"); + int lastSlash = fileName.rfind("/") + 1; + int lastDot = fileName.rfind("."); + + std::string *sub = new std::string( + fileName.substr(lastSlash, lastDot - lastSlash)); + + return sub; +} + static int const basicCost = 100; Path Map::findPath(int startX, int startY, int destX, int destY, |