mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-14 17:20:50 +00:00
pfSellData: drop sell column, use C_Item.GetItemSellPriceByID
Each pfSellData entry was a "sell,buy" string. The sell price duplicates what C_Item.GetItemSellPriceByID returns from the engine's item DBC, so it's redundant in our table — only the buy price (curated from real vendor encounters, not a static item property) needs to live here. Transformed every [id]="X,Y" entry across env/tables.lua, compat/tbc.lua, and modules/turtle-wow.lua to [id]=Y via sed. Format is now itemid → buyPrice (number, copper). sellvalue.lua: reads sell from C_Item.GetItemSellPriceByID(id), reads buy from pfSellData[id]. Items that have only a sell price (not in pfSellData) now display sell-only — previously they got no tooltip addition because the lookup gated on table membership. Items with buy-only (sell == 0 in old data) still display buy correctly. autovendor.lua: replaces the pfSellData[id] gate (which only checked table membership and unused the parsed sell/buy) with a direct C_Item.GetItemSellPriceByID > 0 check — the engine's canonical "is this item sellable to a vendor" answer.
This commit is contained in:
@@ -58,10 +58,9 @@ pfUI:RegisterModule("autovendor", "vanilla:tbc", function ()
|
||||
return
|
||||
end
|
||||
|
||||
-- get value
|
||||
-- only proceed for items the engine reports as vendor-sellable
|
||||
local id = C_Container.GetContainerItemID(bag, slot)
|
||||
if pfSellData[id] then
|
||||
local _, _, sell, buy = strfind(pfSellData[id], "(.*),(.*)")
|
||||
if (id and C_Item.GetItemSellPriceByID(id) or 0) > 0 then
|
||||
this.count = this.count + 1
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user