Skip to content

Include skills granted by the previewed item in item comparisons - #10616

Open
zubSero wants to merge 2 commits into
PathOfBuildingCommunity:devfrom
zubSero:fix/10427-item-granted-skill-preview
Open

zubSero wants to merge 2 commits into
PathOfBuildingCommunity:devfrom
zubSero:fix/10427-item-granted-skill-preview

Conversation

@zubSero

@zubSero zubSero commented Nov 27, 2026 •

Copy link
Copy Markdown

Fixes #10427.

Description of the problem being solved:

Item comparisons (the hover tooltip and Sort by in the item lists) didn't count skills granted by the item you're looking at. Socket groups for granted skills were only created or removed in the main calculation, so a candidate like United in Dream was compared without its Envy, and the DPS went up after you equipped it. It also works the other way: an equipped item's granted skill stayed in the comparison when the candidate replaced that item, which is #8093. The tests cover that case too, so I think this fixes #8093 as well, but I haven't checked it against the build from that issue.

For item previews CalcSetup now works out the granted skill groups on copies of the socket groups, so the preview gets the right skills and the real skill list, the selected main skill and the gems are left alone. Triggered granted skills have their cost cleared on a copy of the skill data during a preview, not on the shared data.

A disabled granted skill group stays disabled in the preview.

While doing this I found that removing a granted skill group shifted the groups after it, so the main skill index pointed at the next skill. That already happened on dev when you really swapped the item (with United in Dream first in the list and Ethereal Knives selected, swapping to a plain Cutlass made Fireball the main skill), and with this change it would also show up in the comparisons. The main group is now looked up again after granted groups are removed, in both cases.

Steps taken to verify a working solution:

  • Added a test that previewing United in Dream gives the same DPS as equipping it, previewing the old item again gives the old DPS, and a disabled Envy stays off. It fails on dev.
  • Added a test that the main skill stays selected when a granted group before it is removed, both in the preview and after really swapping the item. It fails on dev.
  • Added a test that previewing an item with a triggered skill leaves the skill data and the skill list alone. That one already passes on dev, it's there so the copy doesn't regress.
  • Ran the full test suite.

Removing an item-granted skill group shifted the groups after it, so the
main skill index pointed at the next skill. That happened when the item
was really swapped, and with the preview change also in item comparisons.
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.

Item tooltip comparison and unique "Sort by" ignore skills granted by the candidate item Fix stat differences for granted skills

1 participant