File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Source_LegacyAH/Tabs/DataProviders Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ local function GroupAuctions(allAuctions)
188188 local seenDetails = {}
189189
190190 local results = {}
191- for _ , auction in ipairs (allAuctions ) do
191+ for index , auction in ipairs (allAuctions ) do
192192 local newEntry = {
193193 itemLink = auction .itemLink ,
194194 unitPrice = Auctionator .Utilities .ToUnitPrice (auction ),
@@ -201,6 +201,7 @@ local function GroupAuctions(allAuctions)
201201 minBid = auction .info [Auctionator .Constants .AuctionItemInfo .MinBid ],
202202 bidder = auction .info [Auctionator .Constants .AuctionItemInfo .Bidder ],
203203 timeLeft = auction .timeLeft ,
204+ index = index ,
204205 }
205206 if newEntry .itemLink ~= nil then
206207 local key = ToUniqueKey (newEntry )
@@ -213,6 +214,18 @@ local function GroupAuctions(allAuctions)
213214 end
214215 end
215216
217+ table.sort (results , function (a , b )
218+ if a .bidAmount > 0 and b .bidAmount == 0 then
219+ return true
220+ elseif b .bidAmount > 0 and a .bidAmount == 0 then
221+ return false
222+ elseif a .bidAmount > 0 and b .bidAmount > 0 then
223+ return a .bidAmount > b .bidAmount
224+ else
225+ return a .index < b .index
226+ end
227+ end )
228+
216229 return results
217230end
218231
You can’t perform that action at this time.
0 commit comments