ACF5: Fix some turn bugs relating to 3rd wave
authorWuzzy <Wuzzy2@mail.ru>
Sun, 26 May 2019 16:16:47 +0200
changeset 15062 de864caac024
parent 15061 c88201afcc7c
child 15063 0358a907b8f4
ACF5: Fix some turn bugs relating to 3rd wave
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua	Sun May 26 16:01:33 2019 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua	Sun May 26 16:16:47 2019 +0200
@@ -631,6 +631,7 @@
   TurnNatives()
   PutCircles()
   DeployHog()
+  EndTurn(true)
   if nativesNum > 1 then
     IsolateNatives()
   end
@@ -652,7 +653,6 @@
   AddEvent(CheckWaveDead, {3}, DoWaveDead, {3}, 0)
   AddEvent(CheckDeployedDead, {}, DoDeployedDead, {}, 0)
   HideCyborg()
-  EndTurn(true)
   ShowMission(loc("Backstab"), loc("Drills"), loc("You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: You might want to use some mines ..."), 1, 12000)
 end
 
@@ -1228,7 +1228,7 @@
 end
 
 function onEndTurn()
-  if stage == platformStage then
+  if stage == platformStage and wave3TurnsLeft ~= nil then
     wave3TurnsLeft = wave3TurnsLeft - 1
     if wave3TurnsLeft == 0 then
       DoTurnsOver()