Skip to content

Commit

Permalink
Add nasty retarded checking to ENSURE that Auc's API is available whe…
Browse files Browse the repository at this point in the history
…n Auc is loaded... cache Auc prices since they don't

Sorry Auc users, bitch at Norgs to implement GetAuctionBuyout if you want proper support
  • Loading branch information
tekkub committed Mar 16, 2009
1 parent 505853a commit 45817fe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tekAucQuery.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@

local lib = LibStub:NewLibrary("tekAucQuery", 1)
local lib = LibStub:NewLibrary("tekAucQuery", 2)
if not lib then return end

setmetatable(lib, {
__index = function(t,i)
if not i then return end
return GetAuctionBuyout and GetAuctionBuyout(i)
or AucAdvanced and AucAdvanced.Modules.Util.Appraiser.GetPrice(i, nil, true)
if GetAuctionBuyout then return GetAuctionBuyout(i) end
if AucAdvanced and AucAdvanced.Modules and AucAdvanced.Modules.Util.Appraiser and AucAdvanced.Modules.Util.Appraiser.GetPrice then
local p = AucAdvanced.Modules.Util.Appraiser.GetPrice(i, nil, true)
t[i] = p
return p
end
end,
})

0 comments on commit 45817fe

Please sign in to comment.