ctf_stats: Add map name to match summary (#495)

This commit is contained in:
ANAND 2019-11-25 02:08:15 +05:30 committed by Thomas--S
parent 64793ea22c
commit 4de074dc17
3 changed files with 23 additions and 1 deletions

View file

@ -285,6 +285,11 @@ local function place_map(map)
end, nil)
end
ctf_map.registered_on_map_loaded = {}
function ctf_map.register_on_map_loaded(func)
ctf_map.registered_on_map_loaded[#ctf_map.registered_on_map_loaded + 1] = func
end
ctf_match.register_on_new_match(function()
minetest.clear_objects({ mode = "quick" })
@ -366,6 +371,11 @@ ctf_match.register_on_new_match(function()
-- Update players' skyboxes last
ctf_map.set_skybox_all()
-- Run on_map_loaded callbacks
for i = 1, #ctf_map.registered_on_map_loaded do
ctf_map.registered_on_map_loaded[i](ctf_map.map)
end
end)
function ctf_match.create_teams()