Made pressing the button in mapContainer only randomize things if client is master. Fixes issue 545. Also synchronized themes. Fixes issue 547.
authordag10
Fri, 01 Mar 2013 15:50:00 -0500
changeset 8619 253750e192e7
parent 8618 7e71dba4e7f3
child 8621 f9677715a582
child 8622 2045bdf1b11b
Made pressing the button in mapContainer only randomize things if client is master. Fixes issue #545. Also synchronized themes. Fixes issue 547.
QTfrontend/ui/widget/mapContainer.cpp
--- a/QTfrontend/ui/widget/mapContainer.cpp	Fri Mar 01 10:38:49 2013 -0500
+++ b/QTfrontend/ui/widget/mapContainer.cpp	Fri Mar 01 15:50:00 2013 -0500
@@ -462,6 +462,8 @@
 
 void HWMapContainer::setRandomMap()
 {
+    if (!m_master) return;
+    
     setRandomSeed();
     switch(m_mapInfo.type)
     {
@@ -491,7 +493,7 @@
     if(!m_themeModel->rowCount()) return;
     quint32 themeNum = rand() % m_themeModel->rowCount();
     updateTheme(m_themeModel->index(themeNum));
-    qDebug() << "RANDOM THEME:" << themeNum;
+    emit themeChanged(m_theme);
 }
 
 void HWMapContainer::intSetTemplateFilter(int filter)