From c5dd02533189e6766ba1012cd661da3279093542 Mon Sep 17 00:00:00 2001 From: Giovanni Gargani Date: Sun, 17 Jul 2016 19:37:55 +0200 Subject: [PATCH] Was not showing vendor prie when needed --- MissionCache.lua | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/MissionCache.lua b/MissionCache.lua index 1c11a39..e0ea1e2 100644 --- a/MissionCache.lua +++ b/MissionCache.lua @@ -71,20 +71,27 @@ function module:OnInitialized() end local function GetMarketValue(self,itemId) local rc,price,source=true,0,"Unk" - for i,k in pairs(appraisers) do - addon.AuctionPrices=true - rc,price=pcall(k,itemId) - if rc and price and price >0 then - source=i - break + local itemlink=select(2,GetItemInfo(itemId)) + if itemlink then + if not I:IsBop(itemlink) then + for i,k in pairs(appraisers) do + addon.AuctionPrices=true + rc,price=pcall(k,itemId) + if rc and price and price >0 then + source=i + break + end + price=0 + end + end + local vendorprice=tonumber(select(11,GetItemInfo(itemId))) or 0 + if price >vendorprice then + return price,source + else + return vendorprice,'Vendor' end - price=0 - end - local vendorprice=tonumber(select(11,GetItemInfo(item))) or 0 - if price >vendorprice then - return price,source else - return vendorprice,'VND' + return price,source end end addon.GetMarketValue=GetMarketValue -- 1.7.9.5