From 680dd4c87ca5b34050d49a5e76adc9d5d79f1195 Mon Sep 17 00:00:00 2001 From: ANAND Date: Thu, 31 Oct 2019 15:19:34 +0530 Subject: [PATCH] Fix crash upon invoking /maps_reload (#486) --- mods/ctf/ctf_map/schem_map.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mods/ctf/ctf_map/schem_map.lua b/mods/ctf/ctf_map/schem_map.lua index a6a5a1b..cc47b23 100644 --- a/mods/ctf/ctf_map/schem_map.lua +++ b/mods/ctf/ctf_map/schem_map.lua @@ -244,7 +244,16 @@ minetest.register_chatcommand("maps_reload", { func = function(name, param) local maps = load_maps() next_idx = nil - return true, #maps .. " maps found: " .. table.concat(maps, ", ") + + local ret = #maps .. " maps found:\n" + for i = 1, #maps do + ret = ret .. " * " .. ctf_map.available_maps[i].name + if i ~= #maps then + ret = ret .. "\n" + end + end + + return true, ret end, })