Fix Vendor Values legacy fallback before live price is known

This commit is contained in:
Dusk-92
2026-08-24 08:52:07 +02:00
parent 2b677a5f27
commit 839a042402
+6 -3
View File
@@ -155,8 +155,9 @@ end
-- Vendor Values keeps its original static database as an immediate fallback.
-- Once all addon files are loaded, wrap that database so ClassicAPI's live
-- price wins whenever the client has the item record. Successful live reads
-- are cached in Lua for the rest of the session.
-- price wins whenever the client has a positive sell price. Nil/zero is treated
-- as unavailable here so the historical ShaguTweaks database can still provide
-- an immediate value before ClassicAPI has learned the merchant price.
API.PrepareVendorValues = function()
if not API.itemprice or not ShaguTweaks.SellValueDB or ShaguTweaks.SellValueLegacyDB then
return
@@ -172,7 +173,9 @@ API.PrepareVendorValues = function()
end
local price = API.GetItemSellPriceByID(itemID)
if price ~= nil then
if price and price > 0 then
-- Cache only confirmed positive live prices. Never cache nil/zero: a
-- later merchant/cache update may make the real price available.
rawset(tab, itemID, price)
return price
end