Repository navigation
Description
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:
- Skills tab, create a new socket group.
- In the first gem row, type and pick Arc (default gem level setting: e.g. "Normal maximum", so the row shows level 20).
- 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:
PathOfBuilding/src/Classes/SkillsTab.lua
Lines 823 to 829 in a69391d
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):
PathOfBuilding/src/Classes/SkillsTab.lua
Lines 1226 to 1230 in a69391d
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:
PathOfBuilding/src/Modules/CalcSetup.lua
Lines 1873 to 1880 in a69391d
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