Skip to content

Newly picked gem keeps its level 1 attribute requirement until the group is reprocessed #10428

Open

Description

@adam-solvedexile

What happens

When you pick a gem into an empty gem row, its attribute requirement is worked out at gem level 1. That happens even though the row is then set to the default gem level (for example 20). The wrong requirement stays until something else reprocesses the socket group: selecting another group and coming back, editing the level, or reopening the build.

Steps:

  1. Skills tab, create a new socket group.
  2. In the first gem row, type and pick Arc (default gem level setting: e.g. "Normal maximum", so the row shows level 20).
  3. Look at the Int requirement: the sidebar requirement/warning, Calcs tab > Attributes "Int Requirement", or the gem's requirement in its tooltip.

Expected: the level-20 Arc Int requirement.
Actual: the level-1 Arc Int requirement. Clicking another socket group and then back to this one (or saving and reopening) changes it to the level-20 value with no edit made. A missing "you do not meet the Int requirement" warning can appear or disappear the same way.

Cause

In the gem-name change callback the group is processed before the new gem's level is set:

  • gemInstance.gemId = gemId
    gemInstance.skillId = nil
    self:ProcessSocketGroup(self.displayGroup)
    -- New gems need to be constrained by ProcessGemLevel
    gemInstance.level = self:ProcessGemLevel(gemInstance.gemData)
    gemInstance.naturalMaxLevel = gemInstance.level
    slot.level:SetText(gemInstance.level)

ProcessSocketGroup works out reqLevel/reqStr/reqDex/reqInt from gemInstance.level, which is still 1 for a new row (the instance is created with level = 1 at #L795-L804):

  • if gemInstance.gemData then
    gemInstance.reqLevel = grantedEffect.levels[gemInstance.level].levelRequirement
    gemInstance.reqStr = calcLib.getGemStatRequirement(gemInstance.reqLevel, grantedEffect.support, gemInstance.gemData.reqStr)
    gemInstance.reqDex = calcLib.getGemStatRequirement(gemInstance.reqLevel, grantedEffect.support, gemInstance.gemData.reqDex)
    gemInstance.reqInt = calcLib.getGemStatRequirement(gemInstance.reqLevel, grantedEffect.support, gemInstance.gemData.reqInt)

Then gemInstance.level = self:ProcessGemLevel(...) sets the real level, but nothing works out the requirement again. The rebuild that follows (Build.lua OnFrame -> UpdateSocketGroups -> BuildOutput) does not call ProcessSocketGroup for user groups. So CalcSetup puts the stale values into env.requirementsTableGems:

  • if gemInstance.gemData and not accelerate.requirementsGems then
    t_insert(env.requirementsTableGems, {
    source = "Gem",
    sourceGem = gemInstance,
    Str = gemInstance.reqOverride or gemInstance.reqStr,
    Dex = gemInstance.reqOverride or gemInstance.reqDex,
    Int = gemInstance.reqOverride or gemInstance.reqInt,
    })

Possible fix

Call self:ProcessSocketGroup(self.displayGroup) again after gemInstance.level is assigned in the name callback, or compute the level before the first call.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions