Add support for playerfactions mod (#37)

Add faction indicator to HUD
This commit is contained in:
Alden Peeters
2019-09-21 09:33:42 -04:00
committed by SmallJoker
parent 95c1165e28
commit aca830fd22
5 changed files with 39 additions and 4 deletions

View File

@ -94,9 +94,13 @@ function areas:canInteract(pos, name)
for _, area in pairs(self:getAreasAtPos(pos)) do
if area.owner == name or area.open then
return true
else
owned = true
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
end
end
owned = true
end
return not owned
end