Don't count support gems when deciding if a gem group is provided - #2411
Open
lucaskarsten wants to merge 1 commit into
Open
Don't count support gems when deciding if a gem group is provided#2411lucaskarsten wants to merge 1 commit into
lucaskarsten wants to merge 1 commit into
Conversation
UpdateGlobalGemCountAssignments re-evaluated `provided` for every enabled gem in a socket group, so the last gem examined decided whether the group counted against the skill slot limit. Support gems carry neither fromItem nor fromTree, so adding any support to a group whose active skill is granted by an item or the passive tree flipped that group to counted. This surfaced as a spurious "You have too many gem groups allocated" warning after socketing supports into the default weapon attack (Bow Shot and friends, which carry fromItem = true in Data/Skills/other.lua) or into a skill granted by a unique. Support gems never occupy a skill slot on their own, so skip them when determining whether the group is provided.
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.
Related to #2400.
Description of the problem being solved:
SkillsTabClass:UpdateGlobalGemCountAssignmentsdecides whether a socket group counts against the skill slot limit, but it re-evaluatesprovidedfor every enabled gem in the group:The guard only stops re-evaluation once
countGroupis already true, so while it is false every further gem gets to overwrite the decision. Support gems carry neitherfromItemnorfromTree, which means a single support is enough to flip a provided group to counted.Two cases hit this:
MeleeBowPlayerand friends carryfromItem = trueinData/Skills/other.lua, so Bow Shot on its own is correctly exempt. Socketing any support into it makes the group count, and a character with 9 real skills reports 10.fromItemis set on the gem instance inCalcSetup.lua(activeGemInstance.fromItem = grantedSkill.sourceItem ~= nil). Same result once a support is added.Support gems never occupy a skill slot on their own, so they are now skipped when determining whether the group is provided. Active skills still decide, and a group holding several active skills still counts once.
Steps taken to verify a working solution:
spec/System/TestGemGroupCount_spec.luacovering both granted paths plus the normal, supported-normal and disabled-group cases. Againstdevit reports 4 successes / 2 failures; with the fix, 6 successes / 0 failures.ghcr.io/pathofbuildingcommunity/pathofbuilding-tests:latest: 571 successes / 0 failures / 0 errors.Link to a build that showcases this PR:
Any bow build with 9 allocated skills that also keeps a supported Bow Shot group. The spec reproduces it without a build file.
Before screenshot:
4 successes / 2 failuresin the new spec, and the skill slot warning shown above.After screenshot:
6 successes / 0 failuresin the new spec,571 successes / 0 failuresfor the whole suite, and no warning.