From 04342ba30a817b126fdef5118562a367fa4ae008 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Thu, 3 Sep 2026 23:34:40 +0200 Subject: [PATCH] Restore SellValueDB compatibility via ClassicAPI --- mods/vendor-values.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/mods/vendor-values.lua b/mods/vendor-values.lua index 86e26bf..6845ed2 100644 --- a/mods/vendor-values.lua +++ b/mods/vendor-values.lua @@ -18,6 +18,29 @@ local function GetVendorPrice(id) end end +-- Keep the historical public SellValueDB contract for addons such as Aux, +-- without restoring the large embedded vendor-price database. Missing entries +-- are resolved lazily through ClassicAPI and cached only after they are known. +local sellValueDB = ShaguTweaks.SellValueDB +if type(sellValueDB) ~= "table" then + sellValueDB = {} +end + +setmetatable(sellValueDB, { + __index = function(tbl, itemID) + local price = GetVendorPrice(itemID) + + -- The old embedded DB omitted unsellable 0-price items, so keep nil for + -- those entries instead of changing the historical SellValueDB contract. + if price and price > 0 then + rawset(tbl, itemID, price) + return price + end + end, +}) + +ShaguTweaks.SellValueDB = sellValueDB + local pendingPrices = {} local function ClearPending(frame)