Battalion: Use official onEndTurn callback
authorWuzzy <Wuzzy2@mail.ru>
Mon, 12 Feb 2018 17:22:29 +0100
changeset 12982 ba577e0b8c27
parent 12981 4c7472d3d483
child 12983 7c3454083489
Battalion: Use official onEndTurn callback
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                                                   ###