share/hedgewars/Data/Scripts/SimpleMission.lua
changeset 13061 8d2087c85b8d
parent 13059 2f21d92eae27
child 13100 61076bb26cb3
--- a/share/hedgewars/Data/Scripts/SimpleMission.lua	Fri Feb 23 13:28:07 2018 +0100
+++ b/share/hedgewars/Data/Scripts/SimpleMission.lua	Fri Feb 23 14:10:03 2018 +0100
@@ -40,7 +40,7 @@
 	Optional fields
 	- ammoConfig		Table containing basic ammo values (default: infinite skip only)
 	- initVars		Table where you set up environment parameters such as MinesNum.
-	- wind			If set, the wind will permanently set to this value (-100..100)
+	- wind			If set, the wind will permanently set to this value (-100..100). Implies gfDisableWind
 	- gears:		Table of objects.
 	- girders		Table of girders
 	- rubbers		Table of rubbers
@@ -641,7 +641,10 @@
 			_G[initVarName] = initVarValue
 		end
 		if #params.teams == 1 then
-			EnableGameFlags(gfOneClanMode)
+			GameFlags = bor(GameFlags, gfOneClanMode)
+		end
+		if params.wind then
+			GameFlags = bor(GameFlags, gfDisableWind)
 		end
 
 		local clanCounter = 0
@@ -695,9 +698,6 @@
 	end
 
 	_G.onNewTurn = function()
-		if params.wind ~= nil then
-			SetWind(params.wind)
-		end
 		_G.sm.gameStarted = true
 
 		if params.customGoalCheck == "turnStart" then
@@ -749,6 +749,9 @@
 				params.goalText = params.goalText .. "|" .. string.format(loc("Mines time: %.2fs"), MinesTime/1000)
 			end
 		end
+		if params.wind then
+			SetWind(params.wind)
+		end
 		ShowMission(params.missionTitle, loc("Scenario"), params.goalText, params.missionIcon, 5000) 
 
 		-- Spawn objects
@@ -861,5 +864,6 @@
 			_G.sm.checkWinOrFail()
 		end
 	end
+
 end