fix(tooltip): skip objective lookup for quests not in the log

Hovering an NPC right after turning in one of its associated quests
spammed a debugstack trace in DEVELOP mode: the learner objective-
correlation block in GetTooltip called QuestLogCache.GetQuestObjectives
for a quest no longer in QuestLogCache (which gracefully returns {} but
logs the stack at line 306).

Guard the NPC and object correlation loops on
QuestiePlayer.currentQuestlog[questId] so live objective progress is only
looked up for quests the player is currently on. Not a crash and no
functional change for active quests.
This commit is contained in:
Xurkon
2026-06-09 17:17:12 -05:00
parent 5a9dce0f13
commit d207feb3db
2 changed files with 11 additions and 2 deletions
+10 -2
View File
@@ -379,7 +379,11 @@ if key:sub(1,2) == "m_" then
if learnedNpc and learnedNpc[10] then
for _, questId in ipairs(learnedNpc[10]) do
local qData = QuestieLearner.data.quests[questId]
if qData and qData[10] then
-- Only correlate live objective progress for quests the player
-- is currently on. A just-turned-in/abandoned quest is no longer in
-- QuestLogCache, so calling GetQuestObjectives for it would log a
-- debugstack and return {} (harmless but noisy in DEVELOP mode).
if qData and qData[10] and QuestiePlayer.currentQuestlog and QuestiePlayer.currentQuestlog[questId] then
for slotIdx = 1, #qData[10] do
local objSlot = qData[10][slotIdx]
if objSlot then
@@ -432,7 +436,11 @@ elseif key:sub(1,2) == "o_" then
if learnedObj and learnedObj[2] then
for _, questId in ipairs(learnedObj[2]) do
local qData = QuestieLearner.data.quests[questId]
if qData and qData[10] then
-- Only correlate live objective progress for quests the player
-- is currently on. A just-turned-in/abandoned quest is no longer in
-- QuestLogCache, so calling GetQuestObjectives for it would log a
-- debugstack and return {} (harmless but noisy in DEVELOP mode).
if qData and qData[10] and QuestiePlayer.currentQuestlog and QuestiePlayer.currentQuestlog[questId] then
for slotIdx = 1, #qData[10] do
local objSlot = qData[10][slotIdx]
if objSlot then