Fix barrier not coming down correctly

This commit is contained in:
rubenwardy 2015-11-28 01:53:12 +00:00
parent 1f3f7d20e9
commit a43bcc78af
3 changed files with 10 additions and 4 deletions

View file

@ -24,6 +24,9 @@ function ctf_match.is_in_build_time()
return ctf_match.build_timer > 0 return ctf_match.build_timer > 0
end end
ctf_match.register_on_new_match(function()
ctf_match.build_timer = ctf.setting("match.build_time")
end)
ctf.register_on_new_game(function() ctf.register_on_new_game(function()
ctf_match.build_timer = ctf.setting("match.build_time") ctf_match.build_timer = ctf.setting("match.build_time")
if ctf_match.build_timer > 0 then if ctf_match.build_timer > 0 then

View file

@ -2,8 +2,11 @@ ctf.register_on_init(function()
ctf._set("match.map_reset_limit", 0) ctf._set("match.map_reset_limit", 0)
end) end)
local old = ctf_match.next
function ctf_match.next() function ctf_match.next()
for i = 1, #ctf_match.registered_on_new_match do
ctf_match.registered_on_new_match[i]()
end
local r = ctf.setting("match.map_reset_limit") local r = ctf.setting("match.map_reset_limit")
if r > 0 then if r > 0 then
minetest.chat_send_all("Resetting the map, this may take a few moments...") minetest.chat_send_all("Resetting the map, this may take a few moments...")
@ -11,10 +14,10 @@ function ctf_match.next()
minetest.delete_area(vector.new(-r, -r, -r), vector.new(r, r, r)) minetest.delete_area(vector.new(-r, -r, -r), vector.new(r, r, r))
minetest.after(1, function() minetest.after(1, function()
old() ctf.reset()
end) end)
end) end)
else else
old() ctf.reset()
end end
end end

@ -1 +1 @@
Subproject commit 43b7d2c86c0a0a7c6f1b8f7d6c35cd936de752c2 Subproject commit e0b9b476ee2fd577e62afaab9b410f009516687b