2015-11-22 20:07:41 +00:00
|
|
|
ctf.register_on_init(function()
|
|
|
|
ctf._set("match.map_reset_limit", 0)
|
|
|
|
end)
|
|
|
|
|
|
|
|
function ctf_match.next()
|
2015-11-28 01:53:12 +00:00
|
|
|
for i = 1, #ctf_match.registered_on_new_match do
|
|
|
|
ctf_match.registered_on_new_match[i]()
|
|
|
|
end
|
|
|
|
|
2015-11-22 20:07:41 +00:00
|
|
|
local r = ctf.setting("match.map_reset_limit")
|
|
|
|
if r > 0 then
|
|
|
|
minetest.chat_send_all("Resetting the map, this may take a few moments...")
|
|
|
|
minetest.after(0.5, function()
|
|
|
|
minetest.delete_area(vector.new(-r, -r, -r), vector.new(r, r, r))
|
|
|
|
|
|
|
|
minetest.after(1, function()
|
2017-11-12 01:23:42 +00:00
|
|
|
minetest.clear_objects()
|
2015-11-28 01:53:12 +00:00
|
|
|
ctf.reset()
|
2016-02-10 19:34:18 +00:00
|
|
|
if vote then
|
|
|
|
vote.active = {}
|
|
|
|
vote.queue = {}
|
|
|
|
vote.update_all_hud()
|
|
|
|
end
|
2015-11-22 20:07:41 +00:00
|
|
|
end)
|
|
|
|
end)
|
|
|
|
else
|
2015-11-28 01:53:12 +00:00
|
|
|
ctf.reset()
|
2016-02-10 19:34:18 +00:00
|
|
|
if vote then
|
|
|
|
vote.active = {}
|
|
|
|
vote.queue = {}
|
|
|
|
vote.update_all_hud()
|
|
|
|
end
|
2015-11-22 20:07:41 +00:00
|
|
|
end
|
|
|
|
end
|