From e122c99b9d31891898bcc127918c3461d1701593 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Sat, 14 Mar 2026 21:07:26 +0000 Subject: [PATCH] Apply changes from https://github.com/PathOfBuildingCommunity/PathOfBuilding/pull/9625 --- src/Classes/TradeQueryGenerator.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Classes/TradeQueryGenerator.lua b/src/Classes/TradeQueryGenerator.lua index 68b5a4f3b..cdd488339 100644 --- a/src/Classes/TradeQueryGenerator.lua +++ b/src/Classes/TradeQueryGenerator.lua @@ -812,6 +812,9 @@ function TradeQueryGeneratorClass:FinishQuery() -- Sort by mean Stat diff rather than weight to more accurately prioritize stats that can contribute more table.sort(self.modWeights, function(a, b) + if a.meanStatDiff == b.meanStatDiff then + return math.abs(a.weight) > math.abs(b.weight) + end return a.meanStatDiff > b.meanStatDiff end) @@ -864,9 +867,6 @@ function TradeQueryGeneratorClass:FinishQuery() local effective_max = MAX_FILTERS - num_extra - -- Prioritize top mods by abs(weight) - table.sort(self.modWeights, function(a, b) return math.abs(a.weight) > math.abs(b.weight) end) - local prioritizedMods = {} for _, entry in ipairs(self.modWeights) do if #prioritizedMods < effective_max then