From 839a042402d361b2e750c476591571be47346162 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Mon, 24 Aug 2026 08:52:07 +0200 Subject: [PATCH] Fix Vendor Values legacy fallback before live price is known --- api.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api.lua b/api.lua index 1aa7b82..134bc22 100644 --- a/api.lua +++ b/api.lua @@ -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