Add factions support

This commit is contained in:
Alden Peeters
2019-09-09 15:55:24 -04:00
parent 95c1165e28
commit c4820a8106
3 changed files with 30 additions and 0 deletions

View File

@ -94,6 +94,11 @@ 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 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
end
else
owned = true
end