share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua
changeset 15062 de864caac024
parent 15061 c88201afcc7c
child 15073 6f51c75994a4
--- 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()