From 0c423c3e773994dcf8a75682b6962f12fc06cbaf Mon Sep 17 00:00:00 2001 From: Lag Date: Sat, 3 Sep 2022 21:17:00 +0200 Subject: [PATCH] update sources after vendor scan --- AtlasLootClassic/Addons/Sources.lua | 5 +++++ AtlasLootClassic/Data/VendorPrice.lua | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/AtlasLootClassic/Addons/Sources.lua b/AtlasLootClassic/Addons/Sources.lua index f38de588..285cb728 100644 --- a/AtlasLootClassic/Addons/Sources.lua +++ b/AtlasLootClassic/Addons/Sources.lua @@ -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() \ No newline at end of file diff --git a/AtlasLootClassic/Data/VendorPrice.lua b/AtlasLootClassic/Data/VendorPrice.lua index c595858a..93076c40 100644 --- a/AtlasLootClassic/Data/VendorPrice.lua +++ b/AtlasLootClassic/Data/VendorPrice.lua @@ -2201,6 +2201,7 @@ end -- Vendor scan --################################ local VendorLockList = {} +local SourcesAddon local UnitGUID, GetMerchantNumItems, GetMerchantItemID, GetMerchantItemCostInfo, GetMerchantItemCostItem, GetItemInfoInstant = UnitGUID, GetMerchantNumItems, GetMerchantItemID, GetMerchantItemCostInfo, GetMerchantItemCostItem, GetItemInfoInstant @@ -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) @@ -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