QTfrontend/mapContainer.cpp
changeset 4419 3d99c2c806ec
parent 4337 85e02b1a8e8f
child 4487 dbf69c7c5e00
--- a/QTfrontend/mapContainer.cpp	Wed Nov 24 16:41:35 2010 -0500
+++ b/QTfrontend/mapContainer.cpp	Wed Nov 24 20:36:46 2010 -0500
@@ -370,7 +370,8 @@
 void HWMapContainer::setSeed(const QString & seed)
 {
     m_seed = seed;
-    changeImage();
+    if (chooseMap->currentIndex() < MAPGEN_LAST)
+        changeImage();
 }
 
 void HWMapContainer::setMap(const QString & map)
@@ -410,11 +411,11 @@
 #include <QMessageBox>
 void HWMapContainer::setRandomMap()
 {
+    setRandomSeed();
     switch(chooseMap->currentIndex())
     {
     case MAPGEN_REGULAR:
     case MAPGEN_MAZE:
-        setRandomSeed();
         setRandomTheme();
         break;
     default:
@@ -429,20 +430,21 @@
 void HWMapContainer::setRandomStatic()
 {
     chooseMap->setCurrentIndex(4 + numMissions + rand() % (chooseMap->count() - 4 - numMissions));
-    m_seed = QUuid::createUuid().toString();
+    setRandomSeed();
 }
 
 void HWMapContainer::setRandomMission()
 {
     chooseMap->setCurrentIndex(3 + rand() % numMissions);
-    m_seed = QUuid::createUuid().toString();
+    setRandomSeed();
 }
 
 void HWMapContainer::setRandomSeed()
 {
     m_seed = QUuid::createUuid().toString();
     emit seedChanged(m_seed);
-    changeImage();
+    if (chooseMap->currentIndex() < MAPGEN_LAST)
+        changeImage();
 }
 
 void HWMapContainer::setRandomTheme()