Skip to content

Fix item rolls moving to other mod lines in builds saved before 2.67 - #10374

Open
mcagnion wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
mcagnion:bugfix/legacy-modrange-unique-order
Open

mcagnion wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
mcagnion:bugfix/legacy-modrange-unique-order

Conversation

@mcagnion

@mcagnion mcagnion commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Description of the problem being solved:

Since 2.67.0, builds saved with 2.66 or earlier load some item rolls onto the wrong mod line. In the build linked below, Rathpith Globe was saved with +15% Chance to Block Spell Damage and loads with +13%, and Taste of Hate's "Fire and Lightning Damage from Hits taken as Cold Damage" goes from 29% to 25%.

#10039 sorts explicit mod lines into stat order when an item is parsed. The sort targets advanced copy text, but its condition (advancedCopy) is also true for item text saved by PoB, which carries {range:} tags. The saved ModRange entries are then applied by line position, which no longer matches after the sort.

This change only sorts text with the in-game advanced copy headers ({ Unique Modifier }, { Prefix Modifier ... }), so saved items keep their line order and their rolls. Pasted advanced copy items are still sorted, and builds saved with 2.67 or later, already stored in stat order, load as before. Ignoring ModRange when a {range:} tag is present would break some 2017-2018 builds, where only ModRange holds the user's rolls.

Side effects: uniques from the unique database and items from builds not saved since 2.67 show their mod lines in text order again, as before 2.67. Builds already saved again with 2.67 or later keep the moved rolls, which this change cannot restore.

Steps taken to verify a working solution:

  • New test: loading a unique saved out of stat order keeps a saved roll on its own line. It fails without this change.
  • The build below shows 15% and 29% again.
  • Compared every ranged mod line of a few hundred real builds between 2.66.2 and this branch: same rolls, apart from a few items affected by the Intangibility parsing change (Add support for 3.29 vestigial and intangibility parsing  #10026).

Link to a build that showcases this PR:

https://pobb.in/8kdqvrLk_OEi (saved with 2.66): the equipped Rathpith Globe (named "Nerfed Rathpith Globe Volatile Orbd" in the build) and Taste of Hate.

Before screenshot:

before-rathpith-globe before-taste-of-hate

After screenshot:

after-rathpith-globe after-taste-of-hate

Since PR 10039, ParseRaw re-sorts explicit mod lines into stat order
whenever advancedCopy is set. Any item text PoB saves with a {range:}
tag or a ranged line sets it, so saved items are re-sorted on load.
ItemsTab:Load then applies the saved ModRange entries by line position,
and builds saved before that change load with rolls on the wrong lines,
for example the spell block roll of Rathpith Globe moving onto its
lightning resistance line.

Only re-sort text that carries the in-game advanced copy headers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant