Skip to content

Don't count support gems when deciding if a gem group is provided - #2411

Open
lucaskarsten wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
lucaskarsten:fix/gem-group-count-supports
Open

Don't count support gems when deciding if a gem group is provided#2411
lucaskarsten wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
lucaskarsten:fix/gem-group-count-supports

Conversation

@lucaskarsten

Copy link
Copy Markdown

Related to #2400.

Description of the problem being solved:

SkillsTabClass:UpdateGlobalGemCountAssignments decides whether a socket group counts against the skill slot limit, but it re-evaluates provided for every enabled gem in the group:

for _, gemInstance in ipairs(socketGroup.gemList) do
    if gemInstance.enabled and not countGroup then
        local grantedEffect = gemInstance.grantedEffect or gemInstance.gemData and gemInstance.gemData.grantedEffect
        local provided = gemInstance.fromItem or gemInstance.fromTree or
            grantedEffect and (grantedEffect.fromItem or grantedEffect.fromTree)
        countGroup = not provided
    end

The guard only stops re-evaluation once countGroup is already true, so while it is false every further gem gets to overwrite the decision. Support gems carry neither fromItem nor fromTree, which means a single support is enough to flip a provided group to counted.

Two cases hit this:

  • The default weapon attacks. MeleeBowPlayer and friends carry fromItem = true in Data/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.
  • Skills granted by an equipped item, where fromItem is set on the gem instance in CalcSetup.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:

  • Added spec/System/TestGemGroupCount_spec.lua covering both granted paths plus the normal, supported-normal and disabled-group cases. Against dev it reports 4 successes / 2 failures; with the fix, 6 successes / 0 failures.
  • Ran the full busted suite in ghcr.io/pathofbuildingcommunity/pathofbuilding-tests:latest: 571 successes / 0 failures / 0 errors.
  • Reproduced by hand on a level 76 Deadeye with 9 allocated skills. Bow Shot alone raises no warning; adding Rapid Attacks I to it produces "You have too many gem groups allocated. Max allowed is 9. You have 10 non-item/non-granted gem groups allocated." The warning is gone with the fix.

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 failures in the new spec, and the skill slot warning shown above.

After screenshot:

6 successes / 0 failures in the new spec, 571 successes / 0 failures for the whole suite, and no warning.

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.
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.

1 participant