From a43bcc78af44328054a361a33a12ff5a3ce52eae Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 28 Nov 2015 01:53:12 +0000 Subject: [PATCH] Fix barrier not coming down correctly --- mods/ctf_match/buildtime.lua | 3 +++ mods/ctf_match/reset.lua | 9 ++++++--- mods/ctf_pvp_engine | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mods/ctf_match/buildtime.lua b/mods/ctf_match/buildtime.lua index 07c6309..954c1c3 100644 --- a/mods/ctf_match/buildtime.lua +++ b/mods/ctf_match/buildtime.lua @@ -24,6 +24,9 @@ function ctf_match.is_in_build_time() return ctf_match.build_timer > 0 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_match.build_timer = ctf.setting("match.build_time") if ctf_match.build_timer > 0 then diff --git a/mods/ctf_match/reset.lua b/mods/ctf_match/reset.lua index d212450..8290a47 100644 --- a/mods/ctf_match/reset.lua +++ b/mods/ctf_match/reset.lua @@ -2,8 +2,11 @@ ctf.register_on_init(function() ctf._set("match.map_reset_limit", 0) end) -local old = 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") if r > 0 then 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.after(1, function() - old() + ctf.reset() end) end) else - old() + ctf.reset() end end diff --git a/mods/ctf_pvp_engine b/mods/ctf_pvp_engine index 43b7d2c..e0b9b47 160000 --- a/mods/ctf_pvp_engine +++ b/mods/ctf_pvp_engine @@ -1 +1 @@ -Subproject commit 43b7d2c86c0a0a7c6f1b8f7d6c35cd936de752c2 +Subproject commit e0b9b476ee2fd577e62afaab9b410f009516687b