fix: trace loot source gameobjects
This commit is contained in:
@@ -2976,6 +2976,21 @@ function QuestieLearner:OnLootOpened()
|
||||
for i = 1, numItems do
|
||||
local _, lootName, _, _, lootQuality = GetLootSlotInfo(i)
|
||||
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)
|
||||
if link then
|
||||
local itemId = tonumber(string.match(link, "item:(%d+)"))
|
||||
|
||||
@@ -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("target", guid, unitType, entityId, name)'))
|
||||
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, 'self:LearnObject(entityId, name)'))
|
||||
assert.is_true(has(learner, 'if unitType == "GameObject" then'))
|
||||
|
||||
Reference in New Issue
Block a user