diff --git a/Modules/Quest/AvailableQuests.lua b/Modules/Quest/AvailableQuests.lua index b9f3296..ee3d5d3 100644 --- a/Modules/Quest/AvailableQuests.lua +++ b/Modules/Quest/AvailableQuests.lua @@ -92,7 +92,10 @@ end function AvailableQuests.UnloadUndoable() local questId, _ = next(availableQuests) while questId do - if (not QuestieDB.IsDoable(questId)) then + -- Only unload if the quest is no longer doable AND is not in the live quest log. + -- The currentQuestlog guard prevents removing frames for completed-but-logged quests + -- (e.g. Quest 8325) where IsDoable returns false but the quest is still accepted. + if (not QuestieDB.IsDoable(questId)) and not QuestiePlayer.currentQuestlog[questId] then QuestieMap:UnloadQuestFrames(questId) end questId, _ = next(availableQuests, questId) @@ -438,7 +441,7 @@ local function StartPeriodicCleanup() local questId, frameList = next(QuestieMap.questIdFrames) while questId do - if completedQuests[questId] then + if completedQuests[questId] and not QuestiePlayer.currentQuestlog[questId] then -- This quest is complete but still has frames on the map Questie:Debug(Questie.DEBUG_INFO, "[AvailableQuests] Cleanup: Removing lingering frames for completed quest:", questId) QuestieMap:UnloadQuestFrames(questId) diff --git a/Modules/Quest/DailyQuests.lua b/Modules/Quest/DailyQuests.lua index 211b6d6..66f4ce5 100644 --- a/Modules/Quest/DailyQuests.lua +++ b/Modules/Quest/DailyQuests.lua @@ -110,7 +110,8 @@ function _DailyQuests:HandleDailyQuests(possibleQuestIds, currentQuestId, type) Questie.db.char.hiddenDailies[type][questId] = nil; else -- If the quest is not in the questlog remove all frames - if (GetQuestLogIndexByID(questId) == 0) then + -- Guard with currentQuestlog to prevent removing frames for completed-but-logged quests + if (GetQuestLogIndexByID(questId) == 0) and not QuestiePlayer.currentQuestlog[questId] then _DailyQuests:HideDailyQuest(questId); end Questie.db.char.hiddenDailies[type][questId] = true; diff --git a/Modules/Quest/QuestieQuest.lua b/Modules/Quest/QuestieQuest.lua index 20abca5..6246df0 100644 --- a/Modules/Quest/QuestieQuest.lua +++ b/Modules/Quest/QuestieQuest.lua @@ -453,8 +453,12 @@ end function QuestieQuest:HideQuest(id) Questie.db.char.hidden[id] = true - QuestieMap:UnloadQuestFrames(id) - QuestieTooltips:RemoveQuest(id) + -- Only unload frames/tooltips if the quest is NOT in the live quest log. + -- A completed-but-logged quest (e.g. Quest 8325) must keep its pins even when hidden. + if not QuestiePlayer.currentQuestlog[id] then + QuestieMap:UnloadQuestFrames(id) + QuestieTooltips:RemoveQuest(id) + end end function QuestieQuest:UnhideQuest(id) @@ -462,6 +466,15 @@ function QuestieQuest:UnhideQuest(id) AvailableQuests.CalculateAndDrawAll() end +--- Returns true when a quest can be safely unloaded from the map/tooltip tracker. +--- Completion is in char.complete AND the quest is not in the live quest log. +--- Prevents Quest 8325 flicker: completed-but-logged quests must keep their pins. +---@param questId number +---@return boolean +function QuestieQuest:IsSafeToUnloadQuestFrames(questId) + return Questie.db.char.complete[questId] and not QuestiePlayer.currentQuestlog[questId] +end + local allianceTournamentMarkerQuests = { [13684] = true, [13685] = true, [13688] = true, [13689] = true, [13690] = true, [13593] = true, [13703] = true, [13704] = true, [13705] = true, [13706] = true } local hordeTournamentMarkerQuests = { [13691] = true, [13693] = true, [13694] = true, [13695] = true, [13696] = true, diff --git a/Modules/Tooltips/TooltipHandler.lua b/Modules/Tooltips/TooltipHandler.lua index ffb8582..7c0634c 100644 --- a/Modules/Tooltips/TooltipHandler.lua +++ b/Modules/Tooltips/TooltipHandler.lua @@ -7,6 +7,8 @@ local l10n = QuestieLoader:ImportModule("l10n") ---@type QuestieDB local QuestieDB = QuestieLoader:ImportModule("QuestieDB") +---@type QuestiePlayer +local QuestiePlayer = QuestieLoader:ImportModule("QuestiePlayer") --- COMPATIBILITY --- local UnitGUID = QuestieCompat.UnitGUID @@ -112,7 +114,7 @@ local function _PlayerHasQuest(questId) end -- 2) Turned in / completed - if IsQuestFlaggedCompleted and IsQuestFlaggedCompleted(questId) then + if IsQuestFlaggedCompleted and IsQuestFlaggedCompleted(questId) and not QuestiePlayer.currentQuestlog[questId] then return true end diff --git a/Modules/Tracker/TrackerUtils.lua b/Modules/Tracker/TrackerUtils.lua index 6182472..6cfa7c6 100644 --- a/Modules/Tracker/TrackerUtils.lua +++ b/Modules/Tracker/TrackerUtils.lua @@ -788,7 +788,7 @@ function TrackerUtils:BuildFallbackQuest(questId) } -- IsComplete must be a method (called as quest:IsComplete()) quest.IsComplete = function(self) - return (isComplete == 1 or (IsQuestFlaggedCompleted and IsQuestFlaggedCompleted(questId))) and 1 or 0 + return (isComplete == 1 or (QuestiePlayer.currentQuestlog[questId] and IsQuestFlaggedCompleted and IsQuestFlaggedCompleted(questId))) and 1 or 0 end return quest