Skip to content

Fix pasted items not selecting correct runes#1877

Merged
LocalIdentity merged 2 commits into
PathOfBuildingCommunity:devfrom
unrealdreamz:fix/rune-range-inference
May 20, 2026
Merged

Fix pasted items not selecting correct runes#1877
LocalIdentity merged 2 commits into
PathOfBuildingCommunity:devfrom
unrealdreamz:fix/rune-range-inference

Conversation

@unrealdreamz
Copy link
Copy Markdown
Contributor

Summary

Fixes #1675

  • reconstruct pasted rune sockets from the full numeric tuple in a rune mod line instead of only the final number
  • avoids using Bonded: secondary rune lines to add extra socketed runes during paste reconstruction
  • adds a regression fixture for a pasted item with Adds 9 to 15 Cold Damage (rune) plus a life-leech rune and an empty socket

Root Cause

Pasted items without explicit Rune: metadata rebuild item.runes from the visible rune mod lines. The matcher grouped rune stats by replacing numbers with #, but retained only the last number in each line. For a range such as Adds 9 to 15 Cold Damage, the target became 15, so the solver could reconstruct three Lesser Glacial Runes (3 to 5) instead of one Greater Glacial Rune (9 to 15). After fixing the range match, Bonded: secondary lines also needed to be excluded from adding additional inferred runes, otherwise a secondary line could consume the remaining empty socket.

Fix

Rune inference now stores and compares all numeric values in a mod line as a vector. The combination search sums vectors, so a range must match both low and high values. During paste reconstruction, Bonded: lines are not used to add extra socketed rune names; the primary rune lines remain the source of truth for rebuilding item.runes.

Validation

  • busted --lua=luajit ../spec/System/TestItemParse_spec.lua
    • PASS: 25 successes / 0 failures / 0 errors / 0 pending : 0.421 seconds
  • git diff --check
    • PASS

Risk/Rollback

Risk is limited to rune reconstruction for pasted items that lack explicit Rune: metadata. Existing parsed rune mod lines still remain intact. Rollback is this commit only.

@LocalIdentity LocalIdentity added the bug: behaviour Behavioral differences label May 20, 2026
@LocalIdentity LocalIdentity changed the title Fix pasted rune range inference Fix pasted items not selecting correct runes May 20, 2026
@LocalIdentity LocalIdentity merged commit 143452a into PathOfBuildingCommunity:dev May 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug: behaviour Behavioral differences

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy Pasting item fills augments incorrectly

2 participants