From 84039ef9fff93cd783a6ec92daf1eac1af89577a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 10 Nov 2012 03:40:00 +0300 Subject: Fix minimaps loading if minimap missing in tmx file. --- src/gui/minimap.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index f155faaea..e86fac09a 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -152,7 +152,7 @@ void Minimap::setMap(const Map *const map) else { std::string tempname = paths.getStringValue("minimaps") - + "graphics/minimaps/" + map->getFilename() + ".png"; + + map->getFilename() + ".png"; ResourceManager *const resman = ResourceManager::getInstance(); minimapName = map->getProperty("minimap"); @@ -160,6 +160,13 @@ void Minimap::setMap(const Map *const map) if (minimapName.empty() && resman->exists(tempname)) minimapName = tempname; + if (minimapName.empty()) + { + tempname = "graphics/minimaps/" + map->getFilename() + ".png"; + if (resman->exists(tempname)) + minimapName = tempname; + } + mMapImage = resman->getImage(minimapName); mCustomMapImage = false; } -- cgit v1.2.3-70-g09d2