share/hedgewars/Data/Scripts/Multiplayer/Random_Weapon.lua
changeset 14235 8edbdd3a1fe7
parent 13725 8e3d2f7d8737
--- a/share/hedgewars/Data/Scripts/Multiplayer/Random_Weapon.lua	Sun Nov 18 21:01:16 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Random_Weapon.lua	Mon Nov 19 00:19:21 2018 +0100
@@ -30,7 +30,7 @@
         local ammo = getTeamValue(name, "ammo")
         -- If there is no ammo, get a random one from the list and store it
         if ammo == nil then
-            ammo = weapons[GetRandom(table.maxn(weapons)) + 1]
+            ammo = weapons[GetRandom(#weapons) + 1]
             setTeamValue(name, "ammo", ammo)
         end
         -- Add the ammo for the hog