Skip to content

Commit 9bea5a3

Browse files
LocalIdentityLocalIdentity
andauthored
Fix PoB Trader not prioritising local weapon mods (#9625)
The PR #9394 made a change to sort the stat list by weight instead of the meanStatDiff like we had it before. This was prioritising high value mods that contributed a low total sum to the item and was forcing the search to ignore low weight but high value mods like local weapon damage rolls Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent f114e03 commit 9bea5a3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Classes/TradeQueryGenerator.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,9 @@ function TradeQueryGeneratorClass:FinishQuery()
916916

917917
-- Sort by mean Stat diff rather than weight to more accurately prioritize stats that can contribute more
918918
table.sort(self.modWeights, function(a, b)
919+
if a.meanStatDiff == b.meanStatDiff then
920+
return math.abs(a.weight) > math.abs(b.weight)
921+
end
919922
return a.meanStatDiff > b.meanStatDiff
920923
end)
921924

@@ -968,9 +971,6 @@ function TradeQueryGeneratorClass:FinishQuery()
968971

969972
local effective_max = MAX_FILTERS - num_extra
970973

971-
-- Prioritize top mods by abs(weight)
972-
table.sort(self.modWeights, function(a, b) return math.abs(a.weight) > math.abs(b.weight) end)
973-
974974
local prioritizedMods = {}
975975
for _, entry in ipairs(self.modWeights) do
976976
if #prioritizedMods < effective_max then

0 commit comments

Comments
 (0)