summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/minimap.cpp4
-rw-r--r--src/map.cpp7
-rw-r--r--src/map.h2
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,
diff --git a/src/map.h b/src/map.h
index 0832df93..9fc32232 100644
--- a/src/map.h
+++ b/src/map.h
@@ -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