fix: properly inject custom zone UiMapData for Ascension custom zones

This commit is contained in:
Xurkon
2026-03-28 23:16:50 -05:00
parent 3af73e9b00
commit 1341f742b9
+26
View File
@@ -52,6 +52,13 @@ local zoneMap = {} -- Generated
function ZoneDB:Initialize()
if QuestieCompat and QuestieCompat.LoadUiMapData then
hooksecurefunc(QuestieCompat, "LoadUiMapData", function()
ZoneDB:ApplyCustomZones()
end)
end
ZoneDB:ApplyCustomZones()
_ZoneDB:GenerateParentZoneToStartingZoneTable()
-- Run tests if debug enabled
@@ -60,6 +67,25 @@ function ZoneDB:Initialize()
end
end
function ZoneDB:ApplyCustomZones()
if _ZoneDB.customZonesApplied then return end
_ZoneDB.customZonesApplied = true
if not QuestieCompat or not QuestieCompat.UiMapData then return end
for uiMapId, data in pairs(QuestieCompat.UiMapData) do
if not uiMapId or type(uiMapId) ~= "number" then
-- skip non-numeric keys
elseif uiMapId > 1000 and _ZoneDB.areaIdToUiMapId[uiMapId] == nil then
_ZoneDB.areaIdToUiMapId[uiMapId] = uiMapId
end
if data and type(data.parentMapID) == "number" and _ZoneDB.areaIdToUiMapId[data.parentMapID] == nil then
_ZoneDB.areaIdToUiMapId[data.parentMapID] = uiMapId
end
end
end
function _ZoneDB:GenerateParentZoneToStartingZoneTable()
for startingZone, parentZone in next, subZoneToParentZone do
parentZoneToSubZone[parentZone] = startingZone