diff --git a/api.lua b/api.lua index 1981727..40a9841 100644 --- a/api.lua +++ b/api.lua @@ -94,7 +94,7 @@ function areas:canInteract(pos, name) for _, area in pairs(self:getAreasAtPos(pos)) do if area.owner == name or area.open then return true - elseif factions_avail and area.faction_open then + elseif areas.factions_available and area.faction_open then local faction_name = factions.get_player_faction(area.owner) if faction_name ~= nil and faction_name == factions.get_player_faction(name) then return true diff --git a/chatcommands.lua b/chatcommands.lua index ef35e7c..b0c4323 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -286,7 +286,7 @@ minetest.register_chatcommand("area_open", { }) -if factions_avail then +if areas.factions_available then minetest.register_chatcommand("area_faction_open", { params = "", description = "Toggle an area open (anyone can interact) or closed to your faction", diff --git a/init.lua b/init.lua index d1df5a0..53d4eb6 100644 --- a/init.lua +++ b/init.lua @@ -2,10 +2,10 @@ -- Based on node_ownership -- License: LGPLv2+ -factions_avail = minetest.global_exists("factions") - areas = {} +areas.factions_available = minetest.global_exists("factions") + areas.adminPrivs = {areas=true} areas.startTime = os.clock()