diff --git a/mods/capturetheflag/ctf/core.lua b/mods/capturetheflag/ctf/core.lua index e333241..7ab1824 100644 --- a/mods/capturetheflag/ctf/core.lua +++ b/mods/capturetheflag/ctf/core.lua @@ -99,7 +99,6 @@ function ctf.init() ctf._set("allocate_mode", 0) ctf._set("maximum_in_team", -1) ctf._set("default_diplo_state", "war") - ctf._set("node_ownership", true) ctf._set("hud", true) for i = 1, #ctf.registered_on_init do @@ -142,7 +141,7 @@ function ctf.setting(name) if set ~= nil then if type(dset) == "number" then return tonumber(set) - elseif type(dset) == "bool" then + elseif type(dset) == "boolean" then return minetest.is_yes(set) else return set diff --git a/mods/capturetheflag/ctf_protect/init.lua b/mods/capturetheflag/ctf_protect/init.lua index 746044b..25c3809 100644 --- a/mods/capturetheflag/ctf_protect/init.lua +++ b/mods/capturetheflag/ctf_protect/init.lua @@ -1,7 +1,18 @@ -- This mod is used to protect nodes in the capture the flag game +ctf.register_on_init(function() + ctf.log("chat", "Initialising...") + + -- Settings: Chat + ctf._set("node_ownership", true) +end) + local old_is_protected = minetest.is_protected function minetest.is_protected(pos, name) + if not ctf.setting("node_ownership") then + return old_is_protected(pos, name) + end + local team = ctf.get_territory_owner(pos) if not team or not ctf.team(team) then