Adjust magic consts
authorunc0rr
Sun, 19 Dec 2010 20:45:15 +0300
changeset 4566 87ee1be17d27
parent 4565 8a1476a5629e
child 4567 73cea98b9eb4
child 4568 f85243bf890e
Adjust magic consts
QTfrontend/mapContainer.cpp
--- a/QTfrontend/mapContainer.cpp	Sun Dec 19 20:33:33 2010 +0300
+++ b/QTfrontend/mapContainer.cpp	Sun Dec 19 20:45:15 2010 +0300
@@ -473,7 +473,7 @@
         emit drawMapRequested();
         break;
     default:
-        if(chooseMap->currentIndex() <= numMissions + MAPGEN_MAP)
+        if(chooseMap->currentIndex() <= numMissions + MAPGEN_MAP + 1)
             setRandomMission();
         else
             setRandomStatic();
@@ -483,13 +483,16 @@
 
 void HWMapContainer::setRandomStatic()
 {
-    chooseMap->setCurrentIndex(MAPGEN_MAP + 2 + numMissions + rand() % (chooseMap->count() - MAPGEN_MAP - 2 - numMissions));
+    int i = MAPGEN_MAP + 3 + numMissions + rand() % (chooseMap->count() - MAPGEN_MAP - 3 - numMissions);
+    chooseMap->setCurrentIndex(i);
     setRandomSeed();
 }
 
 void HWMapContainer::setRandomMission()
 {
-    chooseMap->setCurrentIndex(MAPGEN_MAP + rand() % numMissions);
+    int i = MAPGEN_MAP + 2 + rand() % numMissions;
+    qDebug() << i << MAPGEN_MAP << numMissions;
+    chooseMap->setCurrentIndex(i);
     setRandomSeed();
 }