Conversation
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.
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:
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 savedModRangeentries 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. IgnoringModRangewhen a{range:}tag is present would break some 2017-2018 builds, where onlyModRangeholds 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:
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:
After screenshot: