Better checks for playerfactions mod availability

This commit is contained in:
Alden Peeters 2019-09-13 15:08:44 -04:00
parent a55b9137d4
commit fb08f7adb7
No known key found for this signature in database
GPG Key ID: CDAD63AE9DA934BE
3 changed files with 4 additions and 2 deletions

View File

@ -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 and area.faction_open then
elseif factions_avail 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

View File

@ -286,7 +286,7 @@ minetest.register_chatcommand("area_open", {
})
if factions then
if factions_avail then
minetest.register_chatcommand("area_faction_open", {
params = "<ID>",
description = "Toggle an area open (anyone can interact) or closed to your faction",

View File

@ -2,6 +2,8 @@
-- Based on node_ownership
-- License: LGPLv2+
factions_avail = minetest.global_exists("factions")
areas = {}
areas.adminPrivs = {areas=true}