GE Lua Documentation

Press F to search!

getHighestPrioZone

Definition


-- @/lua/ge/extensions/gameplay/city.lua:30
local function getHighestPrioZone(pos) -- returns the first highest priority zone that contains the position
  local highestPrio = -math.huge
  local highestPrioZone = nil

  if not sites then return nil end

  for _, zone in sites:zonesForPositionIterator(pos, zonesIteratorCtx) do
    local prio = zone.customFields:get(prioFieldName) or 0
    if prio > highestPrio then
      highestPrio = prio
      highestPrioZone = zone
    end
  end

  return highestPrioZone
end

Callers

@/lua/ge/extensions/ui/apps/minimap/additionalInfo.lua
  camPos:set(core_camera.getPositionXYZ())
  local location = gameplay_city.getHighestPrioZone(camPos)
  local locationName = nil
@/lua/ge/extensions/gameplay/city.lua
  local fieldNameFiles = {}
  for _, zone in ipairs(getHighestPrioZone(pos)) do
    for _, suf in ipairs(suffixes) do