# HG changeset patch
# User Wuzzy <Wuzzy2@mail.ru>
# Date 1518885386 -3600
# Node ID 905449169319bd0ae1a2a3dc3e4e7165d4729edc
# Parent  8b6d8418d5802c94cdf4a9b33f6e3be1b022aa99
Battalion: Use AmmoTypeMax for ammo type iterations

diff -r 8b6d8418d580 -r 905449169319 share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua	Sat Feb 17 12:52:47 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua	Sat Feb 17 17:36:26 2018 +0100
@@ -411,13 +411,7 @@
 ]]--
 
 function clearHogAmmo(hog)
-  local lastNum = amRubber
-
-  if amAirMine ~= nil then
-    lastNum = amAirMine
-  end
-
-  for val=0,lastNum do
+  for val=0, AmmoTypeMax do
     AddAmmo(hog, val, 0)
   end
 end
@@ -1352,7 +1346,7 @@
   local hogWepPoints = 0
   local hogHlpPoints = 0
 
-  for ammoType=0,amAirMine do
+  for ammoType=0, AmmoTypeMax do
     local ammoCount = GetAmmoCount(hog, ammoType)
 
     if pointsWeaponVal[ammoType] ~= nil then
@@ -1483,9 +1477,7 @@
 ]]--
 
 function onAmmoStoreInit()
-  local lastNum = amAirMine
-
-  for val=0,lastNum do
+  for val=0, AmmoTypeMax do
     SetAmmo(val, 0, 0, 0, 0)
   end
 end