fix(quest-tag): prefer live quest log tag over static QuestTag.lua data
Ascension sometimes reuses a Blizzard questId for custom content whose group/tag status differs from the original (e.g. 253 "Bride of the Embalmer" is a real group quest here but zeroed by QuestTag.lua for TBC+/WotLK clients). Once a quest is accepted, QuestieDB.GetQuestTagInfo now checks the live questLog entry's questTag before falling back to questTagCorrections and the static QuestTag.lua table. Compat.lua gains QuestTagNameToId, a reverse lookup built from questTagToName.
This commit is contained in:
@@ -1090,6 +1090,14 @@ local questTagToName = {
|
|||||||
[85] = "Heroic",
|
[85] = "Heroic",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Reverse lookup (tag name -> tag id), exposed so callers can convert the live
|
||||||
|
-- questTag string returned by the game's own GetQuestLogTitle back into the
|
||||||
|
-- numeric tag id used throughout Questie.
|
||||||
|
QuestieCompat.QuestTagNameToId = {}
|
||||||
|
for id, name in pairs(questTagToName) do
|
||||||
|
QuestieCompat.QuestTagNameToId[name] = id
|
||||||
|
end
|
||||||
|
|
||||||
-- Retrieves tag information about the quest.
|
-- Retrieves tag information about the quest.
|
||||||
-- https://wowpedia.fandom.com/wiki/API_GetQuestTagInfo
|
-- https://wowpedia.fandom.com/wiki/API_GetQuestTagInfo
|
||||||
function QuestieCompat.GetQuestTagInfo(questId)
|
function QuestieCompat.GetQuestTagInfo(questId)
|
||||||
|
|||||||
@@ -999,6 +999,25 @@ end
|
|||||||
---@param questId number
|
---@param questId number
|
||||||
---@return number|nil questType, string|nil questTag
|
---@return number|nil questType, string|nil questTag
|
||||||
function QuestieDB.GetQuestTagInfo(questId)
|
function QuestieDB.GetQuestTagInfo(questId)
|
||||||
|
-- Prefer the server's own live tag over static data whenever the quest is currently in
|
||||||
|
-- the quest log. Custom servers can reuse a Blizzard quest ID for different content (e.g.
|
||||||
|
-- Ascension's "Bride of the Embalmer" reusing ID 253, which Questie's static QuestTag.lua
|
||||||
|
-- correctly marks as non-group for retail's real quest 253), which the static tables below
|
||||||
|
-- have no way to know about. The live tag is authoritative once available, whether that
|
||||||
|
-- means it HAS a tag the static data misses, or has NO tag the static data wrongly assumes.
|
||||||
|
local cachedQuest = QuestLogCache.questLog_DO_NOT_MODIFY[questId]
|
||||||
|
if cachedQuest then
|
||||||
|
local liveTag = cachedQuest.questTag
|
||||||
|
if liveTag then
|
||||||
|
local liveTagId = QuestieCompat.QuestTagNameToId[liveTag]
|
||||||
|
if liveTagId then
|
||||||
|
return liveTagId, liveTag
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return nil, nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if questTagCorrections[questId] then
|
if questTagCorrections[questId] then
|
||||||
return questTagCorrections[questId][1], questTagCorrections[questId][2]
|
return questTagCorrections[questId][1], questTagCorrections[questId][2]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user