1
0

Make automatic world name generation check worlds from other games as well

This commit is contained in:
luk3yx 2023-10-01 13:10:27 +13:00 committed by mckaygerhard
parent db11d3ec7b
commit 8e5c2c4897

View File

@ -397,7 +397,7 @@ local function create_world_buttonhandler(this, fields)
-- generated name number found. -- generated name number found.
if worldname == "" then if worldname == "" then
local worldnum_max = 0 local worldnum_max = 0
for _, world in ipairs(menudata.worldlist:get_list()) do for _, world in ipairs(menudata.worldlist:get_raw_list()) do
if world.name:match("^World %d+$") then if world.name:match("^World %d+$") then
local worldnum = tonumber(world.name:sub(6)) local worldnum = tonumber(world.name:sub(6))
worldnum_max = math.max(worldnum_max, worldnum) worldnum_max = math.max(worldnum_max, worldnum)