From 75bebafaa9a2c000cfae3adb5effe797e92bc6e3 Mon Sep 17 00:00:00 2001 From: Narcasung Date: Wed, 15 Jul 2026 16:20:51 +0200 Subject: [PATCH] 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. --- Compat/Compat.lua | 8 ++++++++ Database/QuestieDB.lua | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Compat/Compat.lua b/Compat/Compat.lua index 0266a96..badcbff 100644 --- a/Compat/Compat.lua +++ b/Compat/Compat.lua @@ -1090,6 +1090,14 @@ local questTagToName = { [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. -- https://wowpedia.fandom.com/wiki/API_GetQuestTagInfo function QuestieCompat.GetQuestTagInfo(questId) diff --git a/Database/QuestieDB.lua b/Database/QuestieDB.lua index 44c475c..44ce3b7 100644 --- a/Database/QuestieDB.lua +++ b/Database/QuestieDB.lua @@ -999,6 +999,25 @@ end ---@param questId number ---@return number|nil questType, string|nil questTag 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 return questTagCorrections[questId][1], questTagCorrections[questId][2] end