From 98903436160d04de847aba543619723957035ecb Mon Sep 17 00:00:00 2001 From: Xurkon <36556990+Xurkon@users.noreply.github.com> Date: Sat, 21 Feb 2026 11:28:14 -0600 Subject: [PATCH] Fix IsComplete returning 0 when all objectives are finished The inline ternary short-circuited to 0 as soon as objectives[1] existed, regardless of whether all objectives were done. This caused quests using consumable key items (e.g. Cold Iron Key for quest 12843) to incorrectly return IsComplete=0 after using the key, since the key is no longer in the bag (CheckQuestSourceItem=false) and questLogEntry.isComplete is not set by the server until after explicit turn-in. Now iterates questLogEntry.objectives and returns 1 if all are finished, so PopulateObjectiveNotes routes to AddFinisher correctly. --- Database/QuestieDB.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Database/QuestieDB.lua b/Database/QuestieDB.lua index a5f4029..3b40286 100644 --- a/Database/QuestieDB.lua +++ b/Database/QuestieDB.lua @@ -1078,10 +1078,30 @@ function QuestieDB.IsComplete(questId) if has questLogEntry.isComplete then return questLogEntry.isComplete if no objectives and an item is needed but not obtained then return 0 if no objectives then return 1 + if all objectives are finished then return 1 return 0 --]] - return questLogEntry and (questLogEntry.isComplete or (questLogEntry.objectives[1] and 0) or (#questLogEntry.objectives == 0 and noQuestItem and 0) or 1) or 0 + if not questLogEntry then return 0 end + if questLogEntry.isComplete then return questLogEntry.isComplete end + + local objectives = questLogEntry.objectives + if not objectives or #objectives == 0 then + return (noQuestItem and 0) or 1 + end + + -- Check if every objective is finished. Some quests consume their source item (e.g. Cold Iron Key) + -- so CheckQuestSourceItem returns false even though all objectives are done. We should not return 0 + -- in that case because it causes Questie to draw the item-drop NPC on the map instead of the finisher. + local allDone = true + for _, obj in ipairs(objectives) do + if not obj.finished then + allDone = false + break + end + end + + return allDone and 1 or 0 end ---@param self Quest