diff -r e590fb0f2567 -r 8edbdd3a1fe7 share/hedgewars/Data/Scripts/Multiplayer/Random_Weapon.lua --- 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