Skip to content

Fix items from builds saved before 2.67 loading with wrong values - #10376

Open
mcagnion wants to merge 4 commits into
PathOfBuildingCommunity:devfrom
mcagnion:bugfix/legacy-item-load
Open

mcagnion wants to merge 4 commits into
PathOfBuildingCommunity:devfrom
mcagnion:bugfix/legacy-item-load

Conversation

@mcagnion

@mcagnion mcagnion commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Description of the problem being solved:

Builds saved with 2.66 or earlier load some items with wrong values in 2.67. Four separate causes, one commit each. They complement #10374, which fixes the stat-order sort and stays separate.

  • Talismans saved before 2.66 (3.29 export #9992). PoB now adds the base enchant of a Greatwolf or Black Maw Talisman when the item text has none. The saved ModRange entries did not count that line, so each one lands one line early: in the first build below, Eyes of the Greatwolf shows 24% additional Physical Damage Reduction instead of 28%. Enchant lines added from the base data are now left out when the saved ids are matched.
  • Black Maw Talismans and Night's Hold (3.29 export #9992). The old Black Maw Talisman carries "Has 1 Socket" as an implicit, and the base enchant adds it a second time: 2 sockets, and no warning for too many gems. This also shows on Night's Hold taken from the unique database. A base enchant line is no longer added when an active implicit already has the same text.
  • Pasted "value(min-max)" lines (Add parsing support for the advanced copy/paste format #9830). Versions before 2.66 kept a pasted line such as 14(9-21)% as is, with a default ModRange of 0.5. 2.66 reads the roll from the written value, then ItemsTab:Load overwrites it with that default: Crown of the Inward Eye in the second build (the copy with 18% quality) loads 15% instead of 14%. A roll read from the written value is now kept.
  • Lines that became item properties (Add support for 3.29 vestigial and intangibility parsing  #10026, Fix various issues with advanced copy/paste #10039). 2.66 and earlier saved lines such as "Intangibility: 5%", "Memory Strands: 58" or flask duration lines as mod lines, each with a ModRange. 2.67 no longer reads them as mod lines, so later rolls shift by one: the unequipped Entropy Grip in the third build loads its "+(10-13) to all Attributes" craft at the middle of its range instead of the top, and shows +14 instead of +15 with its 20% quality. Save writes at most one ModRange per mod line, so when an item has more entries than lines they are ignored and the {range:} tags of the item text are kept.

Builds already saved again with an affected version keep the wrong values; these changes cannot restore them.

Steps taken to verify a working solution:

  • One new test per fix, each failing without its change.
  • Loaded the builds below and checked the values above. The Black Maw case uses a synthetic build and Night's Hold from the unique database; no real build with an old Black Maw was found.

Link to a build that showcases this PR:

Before screenshot:

before-greatwolf before-nights-hold before-inward-eye before-entropy-grip

After screenshot:

after-greatwolf after-nights-hold after-inward-eye after-entropy-grip

Since the 3.29 data, ParseRaw adds a talisman's base enchant when the
item text has none. Greatwolf and Black Maw Talismans saved before 2.66
have no enchant line, so ItemsTab:Load counted a line that the saved
ModRange ids never included, and each line got the roll of the next one
(Eyes of the Greatwolf: 20% physical damage reduction instead of 24%).

Skip the enchant lines added from the base when numbering the saved ids.
Since the 3.29 data, the Black Maw Talisman base carries "Has 1 Socket"
as an enchant, and ParseRaw adds a base enchant when the item text has
none. Items that carry the same line as an implicit (talismans saved
before 2.66, the Night's Hold unique text, legacy items pasted from the
game) got it twice: the item had two sockets, and the warning for too
many gems in its slot no longer fired.

Skip a base enchant line whose text is already an active implicit.
Before 2.66, PoB could not parse the in-game "value(min-max)" format and
saved a pasted line such as "14(9-21)% increased maximum Life, Mana and
Global Energy Shield" as is, with the default range in its ModRange.
ParseRaw now reads the roll from that value, but ItemsTab:Load then
applied the saved ModRange over it, so the line loaded as 15% instead of
14%, and saving the build kept the wrong value.

Lines whose range comes from their written value keep it on load.

# Conflicts:
#	src/Classes/ItemsTab.lua
PoB 2.66 and older saved in-game property lines such as "Intangibility: 5%"
and "Memory Strands: 58", and flask lines such as "Lasts 4.00 Seconds", as
mod lines with a ModRange entry each. 2.67 reads them as item properties or
skips them, so ItemsTab:Load applied every later ModRange one line too early:
an Entropy Grip saved in 2.66 loaded its "+(10-13) to all Attributes" roll at
0.5 instead of 1.

Save writes at most one ModRange per mod line, so more entries than lines
means the saved positions no longer match. The entries are then ignored and
the {range:} tags of the item text are kept.

The line count leaves out talisman enchants added from the base data, as the
ModRange id loop already does; both now use countSavedModLines.
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