fix(tooltip): robust NPC/object ID resolution via learner GUID parsers

Expose QuestieLearner:GetIdAndTypeFromGUID / GetObjectIdFromGUID /
GetNpcIdFromGUID (they handle modern dash GUIDs AND legacy 0x hex /
GameObject GUIDs). Tooltips now fall back to these when strsplit('-',guid)
can't parse the GUID, so NPC IDs no longer silently fail to write on
hex-GUID units; the Object ID line resolves from the object's GUID when
its name isn't in the lookup. IDs deduped per tooltip.
This commit is contained in:
Xurkon
2026-06-11 17:53:36 -05:00
parent 5abeff2768
commit 150c59fa77
3 changed files with 36 additions and 3 deletions
+8
View File
@@ -3402,6 +3402,14 @@ local GetObjectIdFromGUID = function(guid)
return nil
end
-- Public wrappers so other modules (e.g. tooltips) can reuse the learner's robust GUID
-- parsing. These handle modern dash GUIDs AND legacy 0x hex GUIDs (and GameObject GUIDs),
-- unlike a naive strsplit("-", guid) which returns nothing for hex/object GUIDs — the cause
-- of NPC/Object IDs failing to show on some tooltips.
function QuestieLearner:GetIdAndTypeFromGUID(guid) return GetIdAndTypeFromGUID(guid) end
function QuestieLearner:GetObjectIdFromGUID(guid) return GetObjectIdFromGUID(guid) end
function QuestieLearner:GetNpcIdFromGUID(guid) return GetNpcIdFromGUID(guid) end
local function TraceLearnerEntity(source, guid, unitType, entityId, name)
if not Questie or not Questie.Debug then return end
local prefix = "n/a"