Fix mines not working in first turn in ACF, mission 6 (bug 180)
authorWuzzy <almikes@aol.com>
Mon, 25 Sep 2017 16:07:31 +0200
changeset 12510 cc146b018d14
parent 12509 6dbdb6fab2f9
child 12511 15e9ef8be44f
Fix mines not working in first turn in ACF, mission 6 (bug #180)
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua	Mon Sep 25 15:34:07 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua	Mon Sep 25 16:07:31 2017 +0200
@@ -172,6 +172,7 @@
 cratesNum = 0
 jetCrate = nil
 
+firstTurn = true
 cyborgsKilledBeforeCrates = false
 cratesTaken = false
 doneCyborgsDead = false
@@ -604,7 +605,7 @@
   end
 
   AddHogs()
-  AnimInit()
+  AnimInit(true)
 end
 
 function onGameStart()
@@ -613,8 +614,6 @@
   SetupPlace()
   AnimationSetup()
   SetupEvents()
-  AddAnim(startAnim)
-  AddFunction({func = AfterStartAnim, args = {}})
   ShowMission(loc("Dragon's Lair"), loc("Y Chwiliad"), loc("Find your tribe!|Cross the lake!"), 1, 0)
 end
 
@@ -646,9 +645,10 @@
 end
 
 function onNewTurn()
-  if AnimInProgress() then
-    TurnTimeLeft = -1
-    return
+  if firstTurn then
+    AddAnim(startAnim)
+    AddFunction({func = AfterStartAnim, args = {}})
+    firstTurn = false
   end
   if GetHogTeamName(CurrentHedgehog) == loc("011101000") then
     SetInputMask(band(0xFFFFFFFF, bnot(gmLeft + gmRight + gmLJump + gmHJump)))