Fix tooltip objective population error for event-type objectives with no spawnList

_RegisterObjectiveTooltips: silently return for Type='event' objectives
with no spawnList (e.g. triggerEnd with nil coordinates). These have no
tooltip to register, so mark hasRegisteredTooltips=true and bail out.
For other types, demote from Error to Debug.
This commit is contained in:
Xurkon
2026-02-21 10:35:23 -06:00
parent 9771a53869
commit 052d38c2f7
+18 -3
View File
@@ -525,6 +525,11 @@ function QuestieQuest:CompleteQuest(questId)
end end
QuestieMap:UnloadQuestFrames(questId) QuestieMap:UnloadQuestFrames(questId)
-- Clear the pending-complete guard now that frames are unloaded
if QuestiePlayer.pendingCompleteQuestIds then
QuestiePlayer.pendingCompleteQuestIds[questId] = nil
end
if (QuestieMap.questIdFrames[questId]) then if (QuestieMap.questIdFrames[questId]) then
Questie:Error("Just removed all frames but the framelist seems to still be there!", questId) Questie:Error("Just removed all frames but the framelist seems to still be there!", questId)
end end
@@ -619,6 +624,12 @@ function QuestieQuest:UpdateQuest(questId)
local sourceItemId = (quest and tonumber(quest.sourceItemId)) or 0 local sourceItemId = (quest and tonumber(quest.sourceItemId)) or 0
if quest and (not Questie.db.char.complete[questId] or QuestiePlayer.currentQuestlog[questId]) then if quest and (not Questie.db.char.complete[questId] or QuestiePlayer.currentQuestlog[questId]) then
-- Skip this update if the quest is mid-completion to avoid redrawing objective pins
-- that CompleteQuest is about to remove via UnloadQuestFrames.
if QuestiePlayer.pendingCompleteQuestIds and QuestiePlayer.pendingCompleteQuestIds[questId] then
Questie:Debug(Questie.DEBUG_DEVELOP, "[QuestieQuest:UpdateQuest] Skipping - quest is pending completion:", questId)
return
end
QuestieQuest:PopulateQuestLogInfo(quest) QuestieQuest:PopulateQuestLogInfo(quest)
if QuestieQuest:ShouldShowQuestNotes(questId) then if QuestieQuest:ShouldShowQuestNotes(questId) then
@@ -1261,9 +1272,13 @@ _RegisterObjectiveTooltips = function(objective, questId, blockItemTooltips)
objective.hasRegisteredTooltips = true objective.hasRegisteredTooltips = true
end end
else else
Questie:Error("[QuestieQuest]: [Tooltips] " .. -- No spawnList is expected for server-tracked event objectives (e.g. triggerEnd with no coordinates).
l10n("There was an error populating objectives for %s %s %s %s", objective.Description or "No objective text", -- Mark as registered so this path is not re-entered, and return silently.
questId or "No quest id", 0 or "No objective", "No error")); if objective.Type == "event" then
objective.hasRegisteredTooltips = true
return
end
Questie:Debug(Questie.DEBUG_ELEVATED, "[QuestieQuest]: [Tooltips] No spawnList for objective:", objective.Description, "quest:", questId)
end end
if (not objective.registeredItemTooltips) and objective.Type == "item" and (not blockItemTooltips) and objective.Id then if (not objective.registeredItemTooltips) and objective.Type == "item" and (not blockItemTooltips) and objective.Id then