Repository navigation
Conversation
Resolve named runes before counting their affix capacity. Trim surplus craft selections and rebuild their effects when occupied slots disappear. Preserve imported modifier lines and refresh the crafter's socket and affix controls for layouts up to twelve modifiers. Verified 282 cases across five item, skill and import specs with the local Windows LuaJIT harness.
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.
Follow-up to #2372 (related to #2568).
Description of the problem being solved:
When crafting an item with an affix-capacity modifier (such as
Serle's Triumphgranting+1 Suffix Modifier allowed), shrinking the affix limit leaves stale state behind:prefixes/suffixesand its explicit modifier active in calculations and saved XML.ItemsTabdid not callUpdateAffixControls(), so surviving affix dropdowns stayed stale. Selecting the same affix group in an open slot and restoring the rune could produce duplicate affixes (e.g. twoDexterity4rolls granting+40Dexterity).Rune: Serle's Triumph(without the expanded rune modifier line) computed affix limits before rune lines were generated, leavingaffixLimitat 6 on the first parse.ItemsTabpreallocatedmaxModCount = 9affix rows even though the rare item model allows up to6 + 6 = 12modifiers, and the rune dropdowntooltipFuncdereferencedvaluewithout a nil guard.Changes:
src/Classes/Item.lua: Count rune affix-limit changes after rune lines are resolved; trim overflowing serialized craft selections and recraft when an occupied slot is removed; resetself.fracturedon reparse and preserve disabled capacity lines acrossCraft(); preserve imported explicit modifiers on non-crafted and advanced-copy items.src/Classes/ItemsTab.lua: CallUpdateAffixControls()on crafted items when rune socket count changes; raisemaxModCountfrom9to12; guardvaluein the rune dropdowntooltipFunc.spec/System/TestItemsTab_spec.lua&spec/System/TestItemParse_spec.lua: Add 15 regression tests covering all shrink paths, duplicate-affix prevention, build XML save/reload, mirrored prefix shrink, fractured/custom modifier preservation, 10/12 affix rows, name-only rune imports, and nil rune tooltips.Steps taken to verify a working solution:
Trarthan Cannon+Serle's Triumph).TestItemsTab87/87,TestItemParse95/95,TestItemMods33/33,TestSkillsTab46/46,TestImportReimport21/21; 282/282 passed).git diff --check dev..HEADand confirmedsrc/Data/ModCache.luais unchanged.Link to a build that showcases this PR:
N/A (reproducible from a blank build by crafting a Rare
Trarthan CannonwithSerle's Triumph).Before screenshot:
After screenshot: