Fix radius jewel mods stacking each time Show Node Power is used - #2501
Open
Triplecatt wants to merge 1 commit into
Open
Fix radius jewel mods stacking each time Show Node Power is used#2501Triplecatt wants to merge 1 commit into
Triplecatt wants to merge 1 commit into
Conversation
jewelData.funcList was appended to but never cleared. BuildModList resets jewelData, but GetActiveModListForSlotNum rebuilds the mod list without going through it, so the list grew on every rebuild. CalcSetup adds one radiusJewelList entry per item in it, so each duplicate re-applied the jewel's mods to the nodes in radius. Cleared to nil rather than {} because CalcSetup falls back to the default radius func with funcList or { ... } and an empty table is truthy in Lua.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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:
Using Show Node Power makes radius jewels apply their mods again on every
recalculation, and the old ones are never removed, so the build's stats keep
climbing. On a level 44 Ranger with a single Time-Lost Sapphire, seven rebuilds
took Hit DPS from 2,387 to 47,268 — Average Damage 2,186 to 43,285 and Crit
Multiplier 366% to 1713%.
It's easy to miss because nothing changes on screen right away. The inflated
numbers only show up the next time you change a setting and the build
recalculates.
jewelData.funcList was appended to but never cleared. BuildModList resets
jewelData, but GetActiveModListForSlotNum rebuilds the mod list without going
through it, so the list grew on every rebuild. CalcSetup adds one radiusJewelList
entry per item in that list, which is why the jewel's mods get applied again.
That jewel has 4 JewelFunc mods and each rebuild runs the engine twice (MAIN and
CALCS), so radiusJewelList went 4, 12, 20, 28, 36, 44, 52 — eight more each time.
Cleared to nil rather than {} because CalcSetup falls back to the default radius
func with
funcList or { ... }, and an empty table is truthy in Lua — {} wouldsilently disable radius jewels that don't grant a JewelFunc of their own.
Only jewels with JewelFunc mods are affected; ordinary jewels append nothing.
This is on dev and beta only. master doesn't have GetActiveModListForSlotNum, so
there every path still goes through BuildModList and the reset covers it.
Steps taken to verify a working solution:
2,185.5198873772306; nothing else moves either
with the fix, differing on 631-834 nodes without it
Crit Multiplier 893% → 1566% over five rebuilds
Link to a build that showcases this PR:
https://pobb.in/t8UGd32NHZPV
Level 44 Ranger, 53 allocated nodes, one Time-Lost Sapphire. Tick Show Node
Power, then change the heat map metric and change it back a few times, watching
Average Damage in the sidebar.
Before:
After: