From 37023888b43e8f750518bf8e222941fe834504a0 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 13 Jul 2015 17:12:22 +0100 Subject: [PATCH] New teams after endgame --- mods/capturetheflag/ctf_endgame/init.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mods/capturetheflag/ctf_endgame/init.lua b/mods/capturetheflag/ctf_endgame/init.lua index 897d435..350068b 100644 --- a/mods/capturetheflag/ctf_endgame/init.lua +++ b/mods/capturetheflag/ctf_endgame/init.lua @@ -33,6 +33,19 @@ ctf_flag.register_on_capture(function(attname, flag) minetest.after(0.5, function() ctf.reset() minetest.delete_area(vector.new(-16*2, -16*2, -16*2), vector.new(16*2, 16*2, 16*2)) + ctf.team({name="red", color="red", add_team=true}) + ctf.team({name="blue", color="blue", add_team=true}) + for name, player in pairs(ctf.players) do + local alloc_mode = tonumber(ctf.setting("allocate_mode")) + if alloc_mode == 0 then + return + end + local team = ctf.autoalloc(name, alloc_mode) + if team then + ctf.log("autoalloc", name .. " was allocated to " .. team) + ctf.join(name, team) + end + end end) end end)