Show faction name in HUD

This commit is contained in:
Alden Peeters 2019-09-18 16:47:48 -04:00
parent 8d4a9ac877
commit d324d534c3
No known key found for this signature in database
GPG Key ID: CDAD63AE9DA934BE
2 changed files with 5 additions and 2 deletions

View File

@ -289,7 +289,7 @@ minetest.register_chatcommand("area_open", {
if areas.factions_available then
minetest.register_chatcommand("area_faction_open", {
params = "<ID>",
description = "Toggle an area open/closed for members in your faction."
description = "Toggle an area open/closed for members in your faction.",
func = function(name, param)
local id = tonumber(param)
if not id then

View File

@ -21,10 +21,13 @@ minetest.register_globalstep(function(dtime)
local areaStrings = {}
for id, area in pairs(areas:getAreasAtPos(pos)) do
if area.faction_open and (areas.faction_available == false or factions.get_player_faction(area.owner) == nil) then
area.faction_open = false
end
table.insert(areaStrings, ("%s [%u] (%s%s%s)")
:format(area.name, id, area.owner,
area.open and ":open" or "",
area.faction_open and ":faction" or ""))
area.faction_open and ":"..factions.get_player_faction(area.owner) or ""))
end
for i, area in pairs(areas:getExternalHudEntries(pos)) do