# HG changeset patch
# User Wuzzy <Wuzzy2@mail.ru>
# Date 1518452549 -3600
# Node ID ba577e0b8c27aa9caf322d3d59cc8b535b1596a7
# Parent  4c7472d3d48358320d12d5227986d83e59feeeeb
Battalion: Use official onEndTurn callback

diff -r 4c7472d3d483 -r ba577e0b8c27 share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua	Mon Feb 12 16:41:40 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua	Mon Feb 12 17:22:29 2018 +0100
@@ -242,7 +242,6 @@
 local CurHog = nil -- Current Hedgehog
 local LastTeam = nil -- Last Team
 local CurTeam = nil -- Current Team
-local TurnEnded = true -- Boolean whether current turn ended or not
 
 local mode = 'default' -- Which game type to play
 local luck = 100 -- Multiplier for bonuses like crates
@@ -1293,7 +1292,7 @@
   addTurnAmmo(hog)
 end
 
-function onTurnEnd()
+function onEndTurn()
   local anyHog = nil
   for team, val in pairs(teamNames) do
     -- Count amount of alive hogs in team
@@ -1415,7 +1414,6 @@
   LastTeam = CurTeam
   CurHog = CurrentHedgehog
   CurTeam = getHogInfo(CurHog, 'team')
-  TurnEnded = false
 
   if suddenDeath == true then
     onSuddenDeathTurn()
@@ -1448,13 +1446,6 @@
   LastWaterLine = WaterLine
 end
 
-function onGameTick20()
-  if TurnEnded == false and TurnTimeLeft <= 0 then
-    TurnEnded = true
-    onTurnEnd()
-  end
-end
-
 --[[
   ##############################################################################
   ### GAME START FUNCTIONS                                                   ###