summaryrefslogtreecommitdiff
path: root/src/gui/minimap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/minimap.cpp')
-rw-r--r--src/gui/minimap.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index a5bdc59d..d1c99b84 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -77,21 +77,26 @@ void Minimap::setMap(Map *map)
// Set the title for the Minimap
std::string caption;
- if (map->hasProperty("name"))
- caption = map->getProperty("name");
- else if (map->hasProperty("mapname"))
- caption = map->getProperty("mapname");
- else
+ if (map)
+ caption = map->getName();
+
+ if (caption.empty())
caption = _("Map");
minimap->setCaption(caption);
// Adapt the image
if (mMapImage)
+ {
mMapImage->decRef();
+ mMapImage = 0;
+ }
- ResourceManager *resman = ResourceManager::getInstance();
- mMapImage = resman->getImage(map->getProperty("minimap"));
+ if (map)
+ {
+ ResourceManager *resman = ResourceManager::getInstance();
+ mMapImage = resman->getImage(map->getProperty("minimap"));
+ }
if (mMapImage)
{