Skip to content

Commit 06f9570

Browse files
author
LocalIdentity
committed
Fix crash when sorting some gems by Full DPS
When we were checking to see if a gem could be affected by a possible support gem we were not considering if the gem had a additional granted effect which was the supporting part of the gem Instead of using the granted effect of the support, we were using the granted effect of the gem which caused a bunch of issues for the code that only expects to deal with supports Also applied this logic to cross linked supports too as I noticed it had a similar issue Also made cross link supports skip it's own socketgroup as it's trying to look for other socketgroups that can support it e.g. Ngamahu's Flame was checking it's own Molten Burst gem group which couldn't possible have supports
1 parent 1873646 commit 06f9570

File tree

2 files changed

+40
-23
lines changed

2 files changed

+40
-23
lines changed

src/Modules/CalcActiveSkill.lua

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,18 @@ function calcs.createActiveSkill(activeEffect, supportList, actor, socketGroup,
108108
local rejectedSupportsIndices = {}
109109

110110
for index, supportEffect in ipairs(supportList) do
111-
-- Pass 1: Add skill types from compatible supports
112-
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
113-
for _, skillType in pairs(supportEffect.grantedEffect.addSkillTypes) do
114-
activeSkill.skillTypes[skillType] = true
111+
-- Loop through grantedEffectList until we find a support gem if the gem has an active and support component e.g. Autoexertion
112+
for _, grantedEffect in ipairs(supportEffect.gemData.grantedEffectList) do
113+
if grantedEffect.support then
114+
-- Pass 1: Add skill types from compatible supports
115+
if calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill) then
116+
for _, skillType in pairs(grantedEffect.addSkillTypes) do
117+
activeSkill.skillTypes[skillType] = true
118+
end
119+
else
120+
t_insert(rejectedSupportsIndices, index)
121+
end
115122
end
116-
else
117-
t_insert(rejectedSupportsIndices, index)
118123
end
119124
end
120125

@@ -125,27 +130,35 @@ function calcs.createActiveSkill(activeEffect, supportList, actor, socketGroup,
125130
notAddedNewSupport = true
126131
for index, supportEffectIndex in ipairs(rejectedSupportsIndices) do
127132
local supportEffect = supportList[supportEffectIndex]
128-
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
129-
notAddedNewSupport = false
130-
rejectedSupportsIndices[index] = nil
131-
for _, skillType in pairs(supportEffect.grantedEffect.addSkillTypes) do
132-
activeSkill.skillTypes[skillType] = true
133+
for _, grantedEffect in ipairs(supportEffect.gemData.grantedEffectList) do
134+
if grantedEffect.support then
135+
if calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill) then
136+
notAddedNewSupport = false
137+
rejectedSupportsIndices[index] = nil
138+
for _, skillType in pairs(grantedEffect.addSkillTypes) do
139+
activeSkill.skillTypes[skillType] = true
140+
end
141+
end
133142
end
134143
end
135144
end
136145
until (notAddedNewSupport)
137146

138147
for _, supportEffect in ipairs(supportList) do
139148
-- Pass 2: Add all compatible supports
140-
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
141-
t_insert(activeSkill.effectList, supportEffect)
142-
if supportEffect.isSupporting and activeEffect.srcInstance then
143-
supportEffect.isSupporting[activeEffect.srcInstance] = true
144-
end
145-
if supportEffect.grantedEffect.addFlags and not summonSkill then
146-
-- Support skill adds flags to supported skills (eg. Remote Mine adds 'mine')
147-
for k in pairs(supportEffect.grantedEffect.addFlags) do
148-
skillFlags[k] = true
149+
for _, grantedEffect in ipairs(supportEffect.gemData.grantedEffectList) do
150+
if grantedEffect.support then
151+
if calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill) then
152+
t_insert(activeSkill.effectList, supportEffect)
153+
if supportEffect.isSupporting and activeEffect.srcInstance then
154+
supportEffect.isSupporting[activeEffect.srcInstance] = true
155+
end
156+
if grantedEffect.addFlags and not summonSkill then
157+
-- Support skill adds flags to supported skills (eg. Remote Mine adds 'mine')
158+
for k in pairs(grantedEffect.addFlags) do
159+
skillFlags[k] = true
160+
end
161+
end
149162
end
150163
end
151164
end

src/Modules/CalcSetup.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,10 +1563,14 @@ function calcs.initEnv(build, mode, override, specEnv)
15631563
if supportLists[slotName] then
15641564
-- add socketed supports from other socketGroups
15651565
for _, otherSocketGroup in ipairs(build.skillsTab.socketGroupList) do
1566-
if otherSocketGroup.slot and otherSocketGroup.slot == group.slot then
1566+
if otherSocketGroup.slot and otherSocketGroup.slot == group.slot and not (otherSocketGroup.source and otherSocketGroup.source == group.source) then
15671567
for _, gem in ipairs(otherSocketGroup.gemList) do
1568-
if gem.gemData and gem.gemData.grantedEffect and gem.gemData.grantedEffect.support then
1569-
t_insert(group.displayGemList, gem)
1568+
if gem.gemData and gem.gemData.grantedEffectList then
1569+
for _, grantedEffect in ipairs(gem.gemData.grantedEffectList) do
1570+
if grantedEffect.support then
1571+
t_insert(group.displayGemList, gem)
1572+
end
1573+
end
15701574
end
15711575
end
15721576
end

0 commit comments

Comments
 (0)