Some changes in try to fix issue when you enter
authorunc0rr
Fri, 01 May 2009 09:01:44 +0000
changeset 2021 a591afb43768
parent 2020 f8cd566204ef
child 2022 9bbf8af42ace
Some changes in try to fix issue when you enter room with painted map, but frontend shows generated one (most probably bug is triggered by template filters) Untested.
QTfrontend/mapContainer.cpp
--- a/QTfrontend/mapContainer.cpp	Thu Apr 30 20:20:01 2009 +0000
+++ b/QTfrontend/mapContainer.cpp	Fri May 01 09:01:44 2009 +0000
@@ -229,6 +229,13 @@
 
 void HWMapContainer::changeImage()
 {
+	if (pMap)
+	{
+		disconnect(pMap, 0, this, SLOT(setImage(const QImage)));
+		disconnect(pMap, 0, this, SLOT(setHHLimit(int)));
+		pMap = 0;
+	}
+
 	pMap = new HWMap();
 	connect(pMap, SIGNAL(ImageReceived(const QImage)), this, SLOT(setImage(const QImage)));
 	connect(pMap, SIGNAL(HHLimitReceived(int)), this, SLOT(setHHLimit(int)));
@@ -293,13 +300,14 @@
 	
 	int id = chooseMap->findText(map);
 	if(id > 0) {
-		chooseMap->setCurrentIndex(id);
-		loadMap(id);
 		if (pMap)
 		{
 			disconnect(pMap, 0, this, SLOT(setImage(const QImage)));
+			disconnect(pMap, 0, this, SLOT(setHHLimit(int)));
 			pMap = 0;
 		}
+		chooseMap->setCurrentIndex(id);
+		loadMap(id);
 	}
 }
 
@@ -331,7 +339,7 @@
 
 void HWMapContainer::templateFilterChanged(int filter)
 {
+	emit newTemplateFilter(filter);
 	changeImage();
-	emit newTemplateFilter(filter);
 }