Prevent pollution of global namespace
Renamed factions_avail to areas.factions_available
This commit is contained in:
parent
fb08f7adb7
commit
e7ab99ca9c
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_avail and area.faction_open then
|
elseif areas.factions_available 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_avail then
|
if areas.factions_available 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",
|
||||||
|
|
4
init.lua
4
init.lua
|
@ -2,10 +2,10 @@
|
||||||
-- Based on node_ownership
|
-- Based on node_ownership
|
||||||
-- License: LGPLv2+
|
-- License: LGPLv2+
|
||||||
|
|
||||||
factions_avail = minetest.global_exists("factions")
|
|
||||||
|
|
||||||
areas = {}
|
areas = {}
|
||||||
|
|
||||||
|
areas.factions_available = minetest.global_exists("factions")
|
||||||
|
|
||||||
areas.adminPrivs = {areas=true}
|
areas.adminPrivs = {areas=true}
|
||||||
areas.startTime = os.clock()
|
areas.startTime = os.clock()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue