fix: trace loot source gameobjects

This commit is contained in:
Xurkon
2026-06-05 19:13:16 -05:00
parent ad8f85bf63
commit fa8b204a8f
2 changed files with 17 additions and 0 deletions
+15
View File
@@ -2976,6 +2976,21 @@ function QuestieLearner:OnLootOpened()
for i = 1, numItems do for i = 1, numItems do
local _, lootName, _, _, lootQuality = GetLootSlotInfo(i) local _, lootName, _, _, lootQuality = GetLootSlotInfo(i)
if lootName then if lootName then
if GetLootSourceInfo then
local sources = { GetLootSourceInfo(i) }
local sourceCount = table.getn(sources)
for j = 1, sourceCount, 2 do
local sourceGuid = sources[j]
local sourceQty = sources[j + 1]
TraceLearnerEntity("loot_source", sourceGuid, nil, sourceQty, lootName)
if type(sourceGuid) == "string" then
local sourceId, sourceType = GetIdAndTypeFromGUID(sourceGuid)
if sourceType == "GameObject" and sourceId and sourceId > 0 then
self:LearnObject(sourceId, nil)
end
end
end
end
local link = GetLootSlotLink(i) local link = GetLootSlotLink(i)
if link then if link then
local itemId = tonumber(string.match(link, "item:(%d+)")) local itemId = tonumber(string.match(link, "item:(%d+)"))
+2
View File
@@ -374,6 +374,8 @@ describe("Audit Pass 10 - additional performance findings (snapshot)", function(
assert.is_true(has(learner, 'TraceLearnerEntity("mouseover", guid, unitType, entityId, name)')) assert.is_true(has(learner, 'TraceLearnerEntity("mouseover", guid, unitType, entityId, name)'))
assert.is_true(has(learner, 'TraceLearnerEntity("target", guid, unitType, entityId, name)')) assert.is_true(has(learner, 'TraceLearnerEntity("target", guid, unitType, entityId, name)'))
assert.is_true(has(learner, 'TraceLearnerEntity("loot_target", targetGuid, targetType, targetId, UnitName("target"))')) assert.is_true(has(learner, 'TraceLearnerEntity("loot_target", targetGuid, targetType, targetId, UnitName("target"))'))
assert.is_true(has(learner, 'GetLootSourceInfo then'))
assert.is_true(has(learner, 'TraceLearnerEntity("loot_source", sourceGuid, nil, sourceQty, lootName)'))
assert.is_true(has(learner, 'TraceLearnerEntity("gossip", npcGuid, unitType, id, name)')) assert.is_true(has(learner, 'TraceLearnerEntity("gossip", npcGuid, unitType, id, name)'))
assert.is_true(has(learner, 'self:LearnObject(entityId, name)')) assert.is_true(has(learner, 'self:LearnObject(entityId, name)'))
assert.is_true(has(learner, 'if unitType == "GameObject" then')) assert.is_true(has(learner, 'if unitType == "GameObject" then'))