Fix: Townsfolk not checking npcDataOverrides/objectDataOverrides on custom servers
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
|
||||
- **[Fix — Townsfolk POI Map IDs]** Fixed some Townsfolk POIs not appearing in custom zones. Removed the `uiMapId > 1000` restriction in `ZoneDB:ApplyCustomZones()` that was preventing custom zone IDs below 1000 from being registered as self-mappings. This caused some Townsfolk NPCs with zone IDs < 1000 to fail UiMapId lookups and not display on the map.
|
||||
|
||||
- **[Fix — Townsfolk DataOverrides Lookup]** Fixed Townsfolk initialization to properly check both `QuestieDB.npcData` and `QuestieDB.npcDataOverrides` / `QuestieDB.objectDataOverrides`. On custom servers (Ebonhold, Ascension), the database is loaded via plugins into overrides tables, but `Townsfolk.Initialize()` was only checking the base database tables which are empty until Stage 3 compilation. This affected Flight Masters, Auctioneers, Innkeepers, Repair Vendors, Class Trainers, and Mailboxes.
|
||||
|
||||
- **[Fix — Custom Zone Map Pins]** Fixed map icons not appearing in Ascension custom zones (e.g., Valley of Trials, Northshire Valley). The issue was that custom zone UiMapData was not properly injected into `QuestieCompat.UiMapData` before HBD initialized its map cache. Added `ApplyCustomZones()` function in `ZoneDB` that hooks `ZoneDB.Initialize` to inject custom zones BEFORE the original initialization runs, ensuring HBD's `mapData` table contains custom zone entries like 1244 (Valley of Trials).
|
||||
|
||||
- **[Fix — Zone Name Fallback]** Fixed "Unknown Zone" display for custom zones in the tracker. When `GetZoneNameByID` fails for custom zone IDs, the system now falls back to `GetQuestLogZoneName` which reads the zone header directly from the quest log where custom zone names are properly displayed.
|
||||
|
||||
@@ -24,7 +24,7 @@ end
|
||||
---@param folkTypes table<string, {mask: NpcFlags|integer, requireSubname: boolean, data: NpcId[]}>
|
||||
local function _PopulateTownsfolkTypes(folkTypes) -- populate the table with all npc ids based on the given bitmask
|
||||
local count = 0
|
||||
for id, npcData in pairs(QuestieDB.npcData) do
|
||||
local function ProcessNPC(id, npcData)
|
||||
local flags = npcData[QuestieDB.npcKeys.npcFlags]
|
||||
for name, folkType in pairs(folkTypes) do
|
||||
if flags and bitband(flags, folkType.mask) == folkType.mask then
|
||||
@@ -37,11 +37,29 @@ local function _PopulateTownsfolkTypes(folkTypes) -- populate the table with all
|
||||
end
|
||||
end
|
||||
end
|
||||
if count > 700 then -- 700 seems like a good number
|
||||
count = 0
|
||||
coroutine.yield()
|
||||
end
|
||||
if QuestieDB.npcData then
|
||||
for id, npcData in pairs(QuestieDB.npcData) do
|
||||
ProcessNPC(id, npcData)
|
||||
if count > 700 then
|
||||
count = 0
|
||||
coroutine.yield()
|
||||
end
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
if QuestieDB.npcDataOverrides then
|
||||
for id, npcData in pairs(QuestieDB.npcDataOverrides) do
|
||||
local numericId = tonumber(id)
|
||||
if numericId and (not QuestieDB.npcData or not QuestieDB.npcData[numericId]) then
|
||||
ProcessNPC(numericId, npcData)
|
||||
end
|
||||
if count > 700 then
|
||||
count = 0
|
||||
coroutine.yield()
|
||||
end
|
||||
count = count + 1
|
||||
end
|
||||
count = count + 1
|
||||
end
|
||||
return folkTypes
|
||||
end
|
||||
@@ -135,8 +153,15 @@ function Townsfolk.Initialize()
|
||||
local validProfessionTrainers = Townsfolk.GetProfessionTrainers()
|
||||
for i=1, #validProfessionTrainers do
|
||||
local id = validProfessionTrainers[i]
|
||||
if QuestieDB.npcData[id] then
|
||||
local subName = QuestieDB.npcData[id][QuestieDB.npcKeys.subName]
|
||||
local npcData = nil
|
||||
if QuestieDB.npcData then
|
||||
npcData = QuestieDB.npcData[id]
|
||||
end
|
||||
if not npcData and QuestieDB.npcDataOverrides then
|
||||
npcData = QuestieDB.npcDataOverrides[id] or QuestieDB.npcDataOverrides[tostring(id)]
|
||||
end
|
||||
if npcData then
|
||||
local subName = npcData[QuestieDB.npcKeys.subName]
|
||||
if subName then
|
||||
if townfolk[subName] then -- weapon master,
|
||||
tinsert(townfolk[subName], id)
|
||||
@@ -188,8 +213,15 @@ function Townsfolk.Initialize()
|
||||
for class, trainers in pairs(classTrainers) do
|
||||
local newTrainers = {}
|
||||
for _, trainer in pairs(trainers) do
|
||||
if QuestieDB.npcData[trainer] then
|
||||
local subName = QuestieDB.npcData[trainer][QuestieDB.npcKeys.subName]
|
||||
local npcData = nil
|
||||
if QuestieDB.npcData then
|
||||
npcData = QuestieDB.npcData[trainer]
|
||||
end
|
||||
if not npcData and QuestieDB.npcDataOverrides then
|
||||
npcData = QuestieDB.npcDataOverrides[trainer] or QuestieDB.npcDataOverrides[tostring(trainer)]
|
||||
end
|
||||
if npcData then
|
||||
local subName = npcData[QuestieDB.npcKeys.subName]
|
||||
if subName and string.len(subName) > 0 then
|
||||
tinsert(newTrainers, trainer)
|
||||
end
|
||||
@@ -212,8 +244,15 @@ function Townsfolk.Initialize()
|
||||
local mailboxes = Townsfolk.GetMailboxes()
|
||||
for i=1, #mailboxes do
|
||||
local id = mailboxes[i]
|
||||
if QuestieDB.objectData[id] then
|
||||
local factionID = QuestieDB.objectData[id][QuestieDB.objectKeys.factionID]
|
||||
local objectData = nil
|
||||
if QuestieDB.objectData then
|
||||
objectData = QuestieDB.objectData[id]
|
||||
end
|
||||
if not objectData and QuestieDB.objectDataOverrides then
|
||||
objectData = QuestieDB.objectDataOverrides[id] or QuestieDB.objectDataOverrides[tostring(id)]
|
||||
end
|
||||
if objectData then
|
||||
local factionID = objectData[QuestieDB.objectKeys.factionID]
|
||||
|
||||
if factionID == 0 then
|
||||
tinsert(factionSpecificTownsfolk["Horde"]["Mailbox"], id)
|
||||
|
||||
@@ -194,6 +194,9 @@
|
||||
<li><strong>[Fix — Tracker Objective Nil Check]</strong> Added defensive nil check for <code>objective.Description</code> when rendering quest objectives in <code>QuestieTracker.lua</code>. Custom server quests may have objectives without a Description field, which would previously cause "attempt to index field 'Description' (a nil value)" crash.</li>
|
||||
<li><strong>[Fix — InjectUiMapData Registration]</strong> Fixed <code>QuestiePluginAPI:InjectUiMapData()</code> to call <code>ZoneDB:ApplyCustomZones()</code> after injecting custom zone data, ensuring the zone mappings are properly registered with both <code>ZoneDB</code> and <code>QuestieCompat.UiMapData</code>.</li>
|
||||
<li><strong>[Fix — Realm Name Matching]</strong> Fixed Ascension realm detection in <code>AscensionUiMapData.lua</code> (Questie-X-AscensionDB) to use <code>string.find()</code> instead of exact string comparison. Realms like "Bronzebeard - Warcraft Reborn" now properly match the "Bronzebeard" pattern, allowing custom zone data to load on all Ascension server variants.</li>
|
||||
<li><strong>[Fix — PrintDifficultyColor Nil Text]</strong> Fixed crash in <code>PrintDifficultyColor</code> when quest name is nil. Added defensive nil check in <code>GetColoredQuestName</code> to return early if <code>QuestieDB.QueryQuestSingle</code> returns nil for a quest, preventing "attempt to concatenate local 'text' (a nil value)" errors.</li>
|
||||
<li><strong>[Fix — Townsfolk POI Map IDs]</strong> Fixed some Townsfolk POIs not appearing in custom zones. Removed the <code>uiMapId > 1000</code> restriction in <code>ZoneDB:ApplyCustomZones()</code> that was preventing custom zone IDs below 1000 from being registered as self-mappings. This caused some Townsfolk NPCs with zone IDs < 1000 to fail UiMapId lookups and not display on the map.</li>
|
||||
<li><strong>[Fix — Townsfolk DataOverrides Lookup]</strong> Fixed Townsfolk initialization to properly check both <code>QuestieDB.npcData</code> and <code>QuestieDB.npcDataOverrides</code> / <code>QuestieDB.objectDataOverrides</code>. On custom servers (Ebonhold, Ascension), the database is loaded via plugins into overrides tables, but <code>Townsfolk.Initialize()</code> was only checking the base database tables which are empty until Stage 3 compilation. This affected Flight Masters, Auctioneers, Innkeepers, Repair Vendors, Class Trainers, and Mailboxes.</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
Reference in New Issue
Block a user