From 9bbbf4ac45d8c46ca52e663045415ae0b9401378 Mon Sep 17 00:00:00 2001 From: Relationship <571+relationship@noreply.octowow.st> Date: Thu, 23 Jul 2026 12:19:21 +0000 Subject: [PATCH] Upload files to "/" --- Events.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Events.lua b/Events.lua index 8d33d42..f04196e 100644 --- a/Events.lua +++ b/Events.lua @@ -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)