Refactor buy similar to match by stat descriptors - #2314
Merged
LocalIdentity merged 1 commit intoJun 30, 2026
Merged
Conversation
vaisest
marked this pull request as draft
June 27, 2026 18:28
vaisest
force-pushed
the
refactor-buy-similar-matching-again
branch
from
June 29, 2026 10:04
d177e72 to
40b8260
Compare
vaisest
force-pushed
the
refactor-buy-similar-matching-again
branch
from
June 29, 2026 15:25
40b8260 to
d7aacdb
Compare
vaisest
marked this pull request as ready for review
June 29, 2026 15:25
LocalIdentity
approved these changes
Jun 30, 2026
LocalIdentity
merged commit Jun 30, 2026
7b6fb53
into
PathOfBuildingCommunity:dev
4 of 5 checks passed
prado1506
added a commit
to prado1506/PathOfBuilding-PoE2
that referenced
this pull request
Jun 30, 2026
Resolve conflicts: take upstream's PathOfBuildingCommunity#2314 trade-stat-descriptor refactor (TradeHelpers, CompareBuySimilar, TestTradeHelpers) as the canonical merged version of the local pr/2314; keep both sides for independent features in CalcPerform (Stonefist glove transform + PathOfBuildingCommunity#2159 minion/spectre/companion life pool) and TestDefence (guard-rate precedence regression test + PathOfBuildingCommunity#2159 tests). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the problem being solved:
I don't think my previous approach of looking up mods that would fit the item was really correct. This doesn't have many advantages right now, but I think this is much more maintainable (e.g. new mod categories don't need to be paid attention to), makes more sense, and solves some mod matching issues.
Basically, the idea is to convert the
{n}pattern of stat descriptors to a Lua pattern, which we can then iterate over to find a match. Local vs global mods are handled similar to EE2 by just adding a count filter with all matched optionsSome option-based mods were also fixed that were broken due to casing or incorrect newline handling. Timeless jewel mods are still broken because PoB splits it into two mods, but who cares. This allows for matching mods which can have various forms based on the mod value, and the same descriptors should also include data on whether the value should be negated. This should also fix some mods where the first number in the line is NOT what is entered on the trade site, although this only includes a handful of mods
I'm also going to add tests of some sort
Steps taken to verify a working solution:
Link to a build that showcases this PR:
Before screenshot:
After screenshot:
Based on display item buy similar PR for testing purposes (first 3 commits)