@@ -373,7 +373,8 @@ local objectiveTexts = {} -- { text = lower case objective, kind = quest kind }
373373-- What the last quest log scan found: unfinished objectives per quest (the minimap tooltip
374374-- summary) and when an objective last finished (icons that stop being needed right after show
375375-- the check mark).
376- local questLog = { summary = {}, completedAt = - 100 , byName = {} }
376+ -- scanned: per mob GUID, what the drawn tooltip showed (see IsQuestMob), until the log changes.
377+ local questLog = { summary = {}, completedAt = - 100 , byName = {}, scanned = {} }
377378
378379-- A name found in an unfinished objective ("Kobold Vermin slain: 3/10", "Crate of Supplies:
379380-- 1/4"): its quest kind and progress.
@@ -475,10 +476,31 @@ local function IsQuestMob(unit)
475476 if ok then related = value end
476477 end
477478 if Hidden .Value (related ) then return Hidden .UNKNOWN end
478- if related == false then return false end
479479 local state , title , progress = ByTooltipInfo (unit )
480480 if state == Hidden .UNKNOWN then return Hidden .UNKNOWN end
481+ -- The tooltip lists one of OUR open objectives: marked, whatever the API says. WoW Forever
482+ -- answers "not related" for some mobs whose quest item is a drop (user's Strider young with
483+ -- "Moa a quem moer - 0/5 Carne de Moa" in its tooltip, 2026-11-11), so the tooltip wins.
481484 if state == true then return questLog .FromTitle (title , progress ) end
485+ if related == false then
486+ -- On WoW Forever some mobs' quest lines are only in the DRAWN tooltip, not in its data
487+ -- (the user's Strider young: "Moa a quem moer - 0/5 Carne de Moa" on screen, no icon).
488+ -- Read a hidden drawn tooltip too, once per mob until the quest log changes (cheap).
489+ if state == nil then
490+ local guid = UnitGUID and UnitGUID (unit )
491+ if Hidden .Value (guid ) or type (guid ) ~= " string" then guid = nil end
492+ local cached = guid and questLog .scanned [guid ]
493+ if cached == nil then
494+ local scanned , scannedTitle , scannedProgress = ByTooltipScan (unit )
495+ if scanned == Hidden .UNKNOWN then return Hidden .UNKNOWN end
496+ cached = scanned and { scannedTitle , scannedProgress } or false
497+ if guid then questLog .scanned [guid ] = cached end
498+ end
499+ if cached then return questLog .FromTitle (cached [1 ], cached [2 ]) end
500+ end
501+ -- Otherwise the game's "no" stands: nothing else (quest log names, Questie) overrules it.
502+ return false
503+ end
482504 if related then
483505 -- The tooltip shows nothing open, yet the game says the mob still matters: another quest
484506 -- needs it without showing in the tooltip (often a drop). Its name in an unfinished
936958function RebuildObjectiveTexts ()
937959 wipe (objectiveTexts )
938960 wipe (questLog .byName )
961+ wipe (questLog .scanned )
939962 if not (C_QuestLog and C_QuestLog .GetQuestObjectives ) then return end
940963 -- An objective that was unfinished on the last scan and is finished now plays the sound
941964 -- (once per scan); a quest whose last objective just finished is announced as ready.
@@ -3701,6 +3724,33 @@ SlashCmdList.CSCODERQUESTINDICATOR = function(msg)
37013724 ShowNews ()
37023725 elseif cmd == " debug" then
37033726 ShowDebug ()
3727+ elseif cmd == " why" then
3728+ -- What the detection sees on the target: the game's answer, the tooltip data lines, the
3729+ -- drawn tooltip lines, and the result. For bug reports ("this mob has a quest, no icon").
3730+ local function Out (text ) print (" |cffffd200" .. TITLE .. " |r " .. text ) end
3731+ if not UnitExists (" target" ) then Out (" target a mob first, then /cqi why" ) return end
3732+ local ok , related = pcall (C_QuestLog .UnitIsRelatedToActiveQuest , " target" )
3733+ Out (" related to a quest (game): " .. tostring (ok and related ))
3734+ local data = C_TooltipInfo and C_TooltipInfo .GetUnit and C_TooltipInfo .GetUnit (" target" )
3735+ if Hidden .Table (data ) and Hidden .Table (data .lines ) then
3736+ for i , line in ipairs (data .lines ) do
3737+ if Hidden .Table (line ) then
3738+ Out (string.format (" data %d: type %s, %s%s" , i , tostring (line .type ), tostring (line .leftText ),
3739+ line .completed ~= nil and (" (completed " .. tostring (line .completed ) .. " )" ) or " " ))
3740+ else
3741+ Out (" data " .. i .. " : hidden by the game" )
3742+ end
3743+ end
3744+ else
3745+ Out (" tooltip data: none or hidden" )
3746+ end
3747+ scanner :SetOwner (WorldFrame , " ANCHOR_NONE" ); scanner :ClearLines (); scanner :SetUnit (" target" )
3748+ for i = 2 , scanner :NumLines () do
3749+ local fs = _G [ADDON .. " ScannerTextLeft" .. i ]
3750+ Out (" drawn " .. i .. " : " .. tostring (fs and fs :GetText ()))
3751+ end
3752+ local needed , kind , progress = IsQuestMob (" target" )
3753+ Out (string.format (" result: needed %s, kind %s, progress %s" , tostring (needed ), tostring (kind ), tostring (progress )))
37043754 elseif cmd == " plate" then
37053755 -- Measures the target's nameplate for the preview and prints what was found.
37063756 -- Protected: an error here would leave the text stuck in the chat box.
0 commit comments