Upload files to "/"
This commit is contained in:
+21
-1
@@ -902,8 +902,28 @@ end end
|
||||
local auctionHooked = false
|
||||
local function HookAuctionHouse()
|
||||
if auctionHooked then return end
|
||||
if not PostAuction and not BuyoutAuction and not PlaceAuctionBid then return end
|
||||
-- Vanilla 1.12 uses StartAuction(minBid, buyoutPrice, runTime) to list the
|
||||
-- item currently in the auction sell slot. PostAuction is a TBC+ API and
|
||||
-- does not exist on Turtle/Octowow, which is why listings were never
|
||||
-- being counted. Hook both so the addon keeps working if Turtle ever
|
||||
-- back-ports PostAuction.
|
||||
if not StartAuction and not PostAuction and not BuyoutAuction and not PlaceAuctionBid then return end
|
||||
auctionHooked = true
|
||||
if StartAuction then
|
||||
local _orig = StartAuction
|
||||
StartAuction = function(minBid, buyoutPrice, runTime)
|
||||
_orig(minBid, buyoutPrice, runTime)
|
||||
-- GetAuctionSellItemInfo returns (name, texture, count, ...); count is the stack size.
|
||||
local count = 1
|
||||
if GetAuctionSellItemInfo then
|
||||
local _, _, c = GetAuctionSellItemInfo()
|
||||
if c and c > 0 then count = c end
|
||||
end
|
||||
RelationshipsAchievements:AddStat("auctionsListed", 1)
|
||||
-- (We count one auction per listing action; `count` is stack size, not # of auctions.)
|
||||
local _ = count
|
||||
end
|
||||
end
|
||||
if PostAuction then
|
||||
local _orig = PostAuction
|
||||
PostAuction = function(minBid, buyoutPrice, runTime, stackSize, numStacks)
|
||||
|
||||
Reference in New Issue
Block a user