merge
authornemo
Sun, 23 Feb 2014 13:50:58 -0500
changeset 10156 7c41dba086ba
parent 10153 28e53573fdd2 (diff)
parent 10155 ac01a2aeff69 (current diff)
child 10157 41ee36573792
merge
--- a/QTfrontend/ui/widget/gamecfgwidget.cpp	Sun Feb 23 19:15:39 2014 +0100
+++ b/QTfrontend/ui/widget/gamecfgwidget.cpp	Sun Feb 23 13:50:58 2014 -0500
@@ -445,8 +445,8 @@
         }
         if (param == "SCRIPT")
         {
-            pMapContainer->setScript(value);
             Scripts->setCurrentIndex(Scripts->findText(value));
+            pMapContainer->setScript(Scripts->itemData(Scripts->currentIndex(), GameStyleModel::ScriptRole).toString().toUtf8());
             return;
         }
         if (param == "DRAWNMAP")
@@ -652,6 +652,7 @@
     else
     {
         pMapContainer->setScript(name);
+        pMapContainer->setScript(Scripts->itemData(index, GameStyleModel::ScriptRole).toString().toUtf8());
     }
     emit paramChanged("SCRIPT", QStringList(name));
 }
--- a/share/hedgewars/Data/Scripts/Multiplayer/Tunnels.lua	Sun Feb 23 19:15:39 2014 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Tunnels.lua	Sun Feb 23 13:50:58 2014 -0500
@@ -22,6 +22,9 @@
      end
  end
 
+function onPreviewInit()
+onGameInit()
+end
 
 function onGameInit()
     MapGen = 2