SimpleMission: Set GameFlags more cleanly
authorWuzzy <Wuzzy2@mail.ru>
Thu, 08 Mar 2018 00:46:00 +0100
changeset 13100 61076bb26cb3
parent 13099 071dcdf33f86
child 13101 b500d07a50a1
SimpleMission: Set GameFlags more cleanly
share/hedgewars/Data/Scripts/SimpleMission.lua
--- a/share/hedgewars/Data/Scripts/SimpleMission.lua	Thu Mar 08 00:18:32 2018 +0100
+++ b/share/hedgewars/Data/Scripts/SimpleMission.lua	Thu Mar 08 00:46:00 2018 +0100
@@ -638,13 +638,17 @@
 		Explosives = 0
 
 		for initVarName, initVarValue in pairs(params.initVars) do
-			_G[initVarName] = initVarValue
+			if initVarName == GameFlags then
+				EnableGameFlags(initVarValue)
+			else
+				_G[initVarName] = initVarValue
+			end
 		end
 		if #params.teams == 1 then
-			GameFlags = bor(GameFlags, gfOneClanMode)
+			EnableGameFlags(gfOneClanMode)
 		end
 		if params.wind then
-			GameFlags = bor(GameFlags, gfDisableWind)
+			EnableGameFlags(gfDisableWind)
 		end
 
 		local clanCounter = 0