Skip to content

Commit

Permalink
update sources after vendor scan
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoizame committed Sep 3, 2022
1 parent 07f148e commit 0c423c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions AtlasLootClassic/Addons/Sources.lua
Original file line number Diff line number Diff line change
Expand Up @@ -366,4 +366,9 @@ function Sources:GetSourceTypes()
return SOURCE_TYPES
end

function Sources:ItemSourcesUpdated(itemID)
if not itemID then return end
TooltipTextCache[itemID] = nil
end

Sources:Finalize()
8 changes: 5 additions & 3 deletions AtlasLootClassic/Data/VendorPrice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2201,6 +2201,7 @@ end
-- Vendor scan
--################################
local VendorLockList = {}
local SourcesAddon
local UnitGUID, GetMerchantNumItems, GetMerchantItemID, GetMerchantItemCostInfo, GetMerchantItemCostItem, GetItemInfoInstant =
UnitGUID, GetMerchantNumItems, GetMerchantItemID, GetMerchantItemCostInfo, GetMerchantItemCostItem, GetItemInfoInstant

Expand All @@ -2211,13 +2212,12 @@ local function GetNpcIDFromGuid(guid)
end
end



function VendorPrice.ScanShownVendor()
local targetGUID = UnitGUID("target")
if not targetGUID then return end
local npcID = GetNpcIDFromGuid(targetGUID)
if not npcID or VendorLockList[npcID] then return end
if not SourcesAddon then SourcesAddon = AtlasLoot.Addons:GetAddon("Sources") end

for itemNum = 1, GetMerchantNumItems() do
local vItemID = GetMerchantItemID(itemNum)
Expand Down Expand Up @@ -2247,7 +2247,9 @@ function VendorPrice.ScanShownVendor()
if itemCost ~= "" then
AtlasLoot.dbGlobal.VendorPrice[vItemID] = itemCost
end

if SourcesAddon then
SourcesAddon:ItemSourcesUpdated(vItemID)
end
end

VendorLockList[npcID] = true
Expand Down

0 comments on commit 0c423c3

Please sign in to comment.