Remove factions.version check if it is not necessary to allow opening for multiple factions to every version of playerfactions

This commit is contained in:
Supergoat666
2020-08-25 13:15:52 +02:00
parent f2ae0a6874
commit e2bd0e9e55
4 changed files with 23 additions and 38 deletions

10
api.lua
View File

@ -93,9 +93,13 @@ function areas:canInteract(pos, name)
return true
elseif areas.factions_available and area.faction_open then
if (factions.version or 0) < 2 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
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