diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d56f57..0192bc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## v9.7.9 + +### Fixes +- **[Quest]** Fixed tracker objective count staying stale (e.g. stuck at 14/16 when quest is complete) when an autoloot bot bypasses the standard loot frame. Registered `BAG_UPDATE_DELAYED` event to force a full quest log scan on bag changes, catching progress updates that `QUEST_WATCH_UPDATE` would normally fire for manual looting. + ## v9.7.8 ### Fixes diff --git a/Modules/Quest/QuestEventHandler.lua b/Modules/Quest/QuestEventHandler.lua index 40e9f1e..c0382b5 100644 --- a/Modules/Quest/QuestEventHandler.lua +++ b/Modules/Quest/QuestEventHandler.lua @@ -64,6 +64,7 @@ function QuestEventHandler:RegisterEvents() eventFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") eventFrame:RegisterEvent("NEW_RECIPE_LEARNED") -- Spell objectives; Runes in SoD count as recipes because "Engraving" is a profession? --eventFrame:RegisterEvent("SPELLS_CHANGED") -- Spell objectives + eventFrame:RegisterEvent("BAG_UPDATE_DELAYED") -- Catch quest item loots that bypass QUEST_WATCH_UPDATE (e.g. autoloot bots) eventFrame:RegisterEvent("PLAYER_INTERACTION_MANAGER_FRAME_HIDE") @@ -282,6 +283,9 @@ end function _QuestEventHandler:QuestTurnedIn(questId, xpReward, moneyReward) Questie:Debug(Questie.DEBUG_DEVELOP, "[Quest Event] QUEST_TURNED_IN", xpReward, moneyReward, questId) + -- Block UpdateQuest from redrawing objective pins while completion is in-flight + QuestiePlayer.pendingCompleteQuestIds[questId] = true + if questLog[questId] and questLog[questId].timer then -- Cancel the timer so the quest is not marked as abandoned questLog[questId].timer:Cancel() @@ -348,12 +352,15 @@ function _QuestEventHandler:QuestRemoved(questId) -- QUEST_TURNED_IN was called before QUEST_REMOVED --> quest was turned in if questLog[questId].state == QUEST_LOG_STATES.QUEST_TURNED_IN then Questie:Debug(Questie.DEBUG_INFO, "Quest:", questId, "was turned in before. Completing quest.") - + + -- Ensure the guard is set in case QUEST_REMOVED fires before the combat queue drains + QuestiePlayer.pendingCompleteQuestIds[questId] = true + -- Now that we confirmed the quest was actually turned in (not abandoned), mark it as complete QuestieQuest:CompleteQuest(questId) QuestieJourney:CompleteQuest(questId) QuestieAnnounce:CompletedQuest(questId) - + questLog[questId] = nil return end @@ -677,6 +684,10 @@ function _QuestEventHandler:OnEvent(event, ...) elseif event == "NEW_RECIPE_LEARNED" then Questie:Debug(Questie.DEBUG_DEVELOP, "[EVENT] NEW_RECIPE_LEARNED (QuestEventHandler)") doFullQuestLogScan = true -- If this event is related to a spell objective, a QUEST_LOG_UPDATE will be fired afterwards + elseif event == "BAG_UPDATE_DELAYED" then + -- Autoloot bots can bypass the standard loot frame, skipping QUEST_WATCH_UPDATE for the last items looted. + -- Flag a full scan so the tracker refreshes on the next QUEST_LOG_UPDATE. + doFullQuestLogScan = true elseif event == "PLAYER_INTERACTION_MANAGER_FRAME_HIDE" then local eventType = select(1, ...) if eventType == 1 then diff --git a/Questie-335.toc b/Questie-335.toc index fb0e36c..9ce8443 100644 --- a/Questie-335.toc +++ b/Questie-335.toc @@ -6,7 +6,7 @@ ## Notes-esES: Ayundante de misión ## Notes-ptBR: Ajudante de missão ## Notes-frFR: Assistant de quête -## Version: 9.7.8 +## Version: 9.7.9 ## RequiredDeps: ## OptionalDeps: Ace3, CallbackHandler-1.0, HereBeDragons, LibDataBroker-1.1, LibDBIcon-1.0, LibSharedMedia-3.0, LibStub, LibUIDropDownMenu ## SavedVariables: QuestieConfig