Merge remote-tracking branch 'upstream/master'

This commit is contained in:
2020-09-08 18:45:48 +02:00
9 changed files with 120 additions and 26 deletions

18
api.lua
View File

@ -120,9 +120,21 @@ function areas:canInteract(pos, name)
return true
end
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
if (factions.version or 0) < 2 then
local faction_name = factions.get_player_faction(name)
if faction_name then
for _, fname in ipairs(area.faction_open or {}) do
if faction_name == fname then
return true
end
end
end
else
for _, fname in ipairs(area.faction_open or {}) do
if factions.player_is_in_faction(fname, name) then
return true
end
end
end
end
owned = true