From a7a66810beba85eeef8c13a109564ad3434eed4f Mon Sep 17 00:00:00 2001 From: Xurkon Date: Mon, 16 Mar 2026 23:05:58 -0500 Subject: [PATCH] fix: store fallback quests in TrackerUtils._fallbackQuests not currentQuestlog to prevent arrow/quest module crashes --- Modules/Tracker/QuestieTracker.lua | 10 ++++++++-- Modules/Tracker/TrackerUtils.lua | 16 +++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Modules/Tracker/QuestieTracker.lua b/Modules/Tracker/QuestieTracker.lua index d64c3de..957cbf7 100644 --- a/Modules/Tracker/QuestieTracker.lua +++ b/Modules/Tracker/QuestieTracker.lua @@ -2240,6 +2240,10 @@ end function QuestieTracker:RemoveQuest(questId) Questie:Debug(Questie.DEBUG_DEVELOP, "[QuestieTracker:RemoveQuest] - ", questId) + -- Clean up any fallback quest object we built for this quest + if TrackerUtils._fallbackQuests then + TrackerUtils._fallbackQuests[questId] = nil + end if Questie.db.char.collapsedQuests then Questie.db.char.collapsedQuests[questId] = nil end @@ -2375,10 +2379,12 @@ function QuestieTracker:AQW_Insert(index, expire) if Questie.IsSoD then QuestieDebugOffer.QuestTracking(questId) else - -- Quest not in DB — try building a fallback object from the quest log + -- Quest not in DB — try building a fallback object from the quest log. + -- Store in TrackerUtils._fallbackQuests only, NOT currentQuestlog, + -- so QuestieArrow/QuestieQuest don't call DB-only methods on it. local fallback = TrackerUtils:BuildFallbackQuest(questId) if fallback then - QuestiePlayer.currentQuestlog[questId] = fallback + TrackerUtils._fallbackQuests[questId] = fallback QuestieCombatQueue:Queue(function() QuestieTracker:Update() end) diff --git a/Modules/Tracker/TrackerUtils.lua b/Modules/Tracker/TrackerUtils.lua index 19a8a2a..ee4a33e 100644 --- a/Modules/Tracker/TrackerUtils.lua +++ b/Modules/Tracker/TrackerUtils.lua @@ -694,7 +694,10 @@ end ---@return table sortedQuestIds Table with sorted Quest ID's by Sort Type ---@return table questDetails Table with raw quest table from QuestiePlayer.currentQuestLog, percentage completed value per quest, and a "translated" zoneName --- Builds a minimal quest-like object from the quest log for quests not in QuestieDB. +-- Private cache of fallback quest objects for quests not in QuestieDB. +-- Intentionally NOT stored in QuestiePlayer.currentQuestlog so arrow/map/other modules +-- don't try to call DB-only methods on them. +TrackerUtils._fallbackQuests = TrackerUtils._fallbackQuests or {} -- Returns nil if the quest is not currently in the quest log. function TrackerUtils:BuildFallbackQuest(questId) for i = 1, GetNumQuestLogEntries() do @@ -761,11 +764,18 @@ function TrackerUtils:GetSortedQuestIds() -- Fallback for quests not in QuestieDB (e.g. custom server quests). -- Build a minimal quest object from the quest log so the tracker can still display it. + -- Stored in TrackerUtils._fallbackQuests, NOT in currentQuestlog, so other modules + -- (Arrow, QuestieQuest) don't try to call DB-only methods on it. if type(quest) ~= "table" or not quest.IsComplete or not quest.Objectives then - local fallback = TrackerUtils:BuildFallbackQuest(qid) + local fallback = TrackerUtils._fallbackQuests[qid] + if not fallback then + fallback = TrackerUtils:BuildFallbackQuest(qid) + if fallback then + TrackerUtils._fallbackQuests[qid] = fallback + end + end if fallback then quest = fallback - QuestiePlayer.currentQuestlog[qid] = fallback end end