From 31ed99b22c9f2f987c7afb1f8b2d8d392c6780a7 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 22 Jan 2018 03:28:16 +0000 Subject: [PATCH] Fix wrong offset logic in next map selector --- mods/ctf_map/schem_map.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mods/ctf_map/schem_map.lua b/mods/ctf_map/schem_map.lua index 556acab..7c29bea 100644 --- a/mods/ctf_map/schem_map.lua +++ b/mods/ctf_map/schem_map.lua @@ -15,9 +15,6 @@ do table.insert(dirs, ".") for _, dir in pairs(dirs) do local files = minetest.get_dir_list(mapdir .. dir, false) - -- if dir ~= "" then - -- dir = dir .. "/" - -- end for i=1, #files do files_hash[dir .. "/" .. files[i]:split(".")[1]] = true end @@ -27,6 +24,7 @@ do for key, _ in pairs(files_hash) do table.insert(ctf_map.available_maps, key) end + print(dump(ctf_map.available_maps)) end @@ -122,7 +120,7 @@ ctf_match.register_on_new_match(function() local idx if ctf_map.map then idx = math.random(#ctf_map.available_maps - 1) - if idx == ctf_map.map.idx then + if idx >= ctf_map.map.idx then idx = idx + 1 end else