Fix IsComplete: check numFulfilled==numRequired instead of finished flag

The finished flag in QuestLogCache is only set to true when the server
sends isComplete=1 via GetQuestLogTitle. For quest 12843 ('They Took
Our Men!'), after using all Cold Iron Keys the objectives numerically
complete (5/5) but isComplete=1 may not fire until the player visits
the turn-in NPC.

Use numFulfilled == numRequired as the completion check instead, which
updates from GetQuestLogLeaderBoard immediately when each objective
fills. Added numRequired > 0 guard to avoid trivially matching
zero-required objectives.
This commit is contained in:
Xurkon
2026-02-21 11:44:32 -06:00
parent e6c9d241fb
commit 25f2ece139
+6 -4
View File
@@ -1090,12 +1090,14 @@ function QuestieDB.IsComplete(questId)
return (noQuestItem and 0) or 1 return (noQuestItem and 0) or 1
end end
-- Check if every objective is finished. Some quests consume their source item (e.g. Cold Iron Key) -- Check if every objective is fulfilled. Use numFulfilled == numRequired rather than the
-- so CheckQuestSourceItem returns false even though all objectives are done. We should not return 0 -- finished flag, because finished is only set by QuestLogCache when the server sends
-- in that case because it causes Questie to draw the item-drop NPC on the map instead of the finisher. -- isComplete=1 via GetQuestLogTitle. For quests using consumable items (e.g. Cold Iron Key
-- for quest 12843), the key is consumed and numFulfilled/numRequired update immediately,
-- but isComplete=1 may not arrive until the player physically visits the turn-in NPC.
local allDone = true local allDone = true
for _, obj in ipairs(objectives) do for _, obj in ipairs(objectives) do
if not obj.finished then if obj.numRequired and obj.numRequired > 0 and obj.numFulfilled ~= obj.numRequired then
allDone = false allDone = false
break break
end end