diff options
-rw-r--r-- | src/gui/minimap.cpp | 4 | ||||
-rw-r--r-- | src/map.cpp | 7 | ||||
-rw-r--r-- | src/map.h | 2 |
3 files changed, 4 insertions, 9 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index 53d58d2e..35844f64 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -98,15 +98,13 @@ void Minimap::setMap(Map *map) if (map) { std::string tempname = - "graphics/minimaps/"+(*map->getFilename())+".png"; + "graphics/minimaps/" + map->getFilename() + ".png"; ResourceManager *resman = ResourceManager::getInstance(); minimapName = map->getProperty("minimap"); if (minimapName.empty() && resman->exists(tempname)) - { minimapName = tempname; - } mMapImage = resman->getImage(minimapName); } diff --git a/src/map.cpp b/src/map.cpp index 7ee18450..52459415 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -580,16 +580,13 @@ const std::string Map::getName() const return getProperty("mapname"); } -const std::string *Map::getFilename() const +const std::string Map::getFilename() 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; + return fileName.substr(lastSlash, lastDot - lastSlash); } Position Map::checkNodeOffsets(int radius, unsigned char walkMask, @@ -269,7 +269,7 @@ class Map : public Properties /** * Gives the map id based on filepath (ex: 009-1) */ - const std::string *getFilename() const; + const std::string getFilename() const; /** * Check the current position against surrounding blocking tiles, and |