Better checks for playerfactions mod availability
This commit is contained in:
parent
a55b9137d4
commit
fb08f7adb7
2
api.lua
2
api.lua
|
@ -94,7 +94,7 @@ function areas:canInteract(pos, name)
|
||||||
for _, area in pairs(self:getAreasAtPos(pos)) do
|
for _, area in pairs(self:getAreasAtPos(pos)) do
|
||||||
if area.owner == name or area.open then
|
if area.owner == name or area.open then
|
||||||
return true
|
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)
|
local faction_name = factions.get_player_faction(area.owner)
|
||||||
if faction_name ~= nil and faction_name == factions.get_player_faction(name) then
|
if faction_name ~= nil and faction_name == factions.get_player_faction(name) then
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -286,7 +286,7 @@ minetest.register_chatcommand("area_open", {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
if factions then
|
if factions_avail then
|
||||||
minetest.register_chatcommand("area_faction_open", {
|
minetest.register_chatcommand("area_faction_open", {
|
||||||
params = "<ID>",
|
params = "<ID>",
|
||||||
description = "Toggle an area open (anyone can interact) or closed to your faction",
|
description = "Toggle an area open (anyone can interact) or closed to your faction",
|
||||||
|
|
Loading…
Reference in New Issue