Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Classes/TradeQueryGenerator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,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)

Expand Down Expand Up @@ -968,9 +971,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
Expand Down
Loading