Skip to content

Commit cba56e3

Browse files
author
LocalIdentity
committed
Revert PR #9143
1 parent 0e5fdac commit cba56e3

File tree

2 files changed

+11
-40
lines changed

2 files changed

+11
-40
lines changed

src/Modules/CalcActiveSkill.lua

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -107,36 +107,13 @@ function calcs.createActiveSkill(activeEffect, supportList, actor, socketGroup,
107107
activeSkill.effectList = { activeEffect }
108108
local rejectedSupportsIndices = {}
109109

110-
-- Return first compatible support grantedEffect plus a flag indicating the support has a support component
111-
local function getGrantedSupportEffect(supportEffect)
112-
local hasSupport = false
113-
if supportEffect.gemData then
114-
for _, grantedEffect in ipairs(supportEffect.gemData.grantedEffectList) do
115-
if grantedEffect and grantedEffect.support then
116-
hasSupport = true
117-
if calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill) then
118-
return grantedEffect, true
119-
end
120-
end
121-
end
122-
elseif supportEffect.grantedEffect then
123-
hasSupport = true
124-
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
125-
return supportEffect.grantedEffect, true
126-
end
127-
end
128-
return nil, hasSupport
129-
end
130-
131110
for index, supportEffect in ipairs(supportList) do
132-
-- Loop through grantedEffectList until we find a support gem if the gem has an active and support component e.g. Autoexertion
133-
local grantedSupportEffect, hasSupport = getGrantedSupportEffect(supportEffect)
134-
if grantedSupportEffect then
135-
-- Pass 1: Add skill types from compatible supports
136-
for _, skillType in pairs(grantedSupportEffect.addSkillTypes) 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
137114
activeSkill.skillTypes[skillType] = true
138115
end
139-
elseif hasSupport then
116+
else
140117
t_insert(rejectedSupportsIndices, index)
141118
end
142119
end
@@ -148,11 +125,10 @@ function calcs.createActiveSkill(activeEffect, supportList, actor, socketGroup,
148125
notAddedNewSupport = true
149126
for index, supportEffectIndex in ipairs(rejectedSupportsIndices) do
150127
local supportEffect = supportList[supportEffectIndex]
151-
local grantedSupportEffect = getGrantedSupportEffect(supportEffect)
152-
if grantedSupportEffect then
128+
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
153129
notAddedNewSupport = false
154130
rejectedSupportsIndices[index] = nil
155-
for _, skillType in pairs(grantedSupportEffect.addSkillTypes) do
131+
for _, skillType in pairs(supportEffect.grantedEffect.addSkillTypes) do
156132
activeSkill.skillTypes[skillType] = true
157133
end
158134
end
@@ -161,15 +137,14 @@ function calcs.createActiveSkill(activeEffect, supportList, actor, socketGroup,
161137

162138
for _, supportEffect in ipairs(supportList) do
163139
-- Pass 2: Add all compatible supports
164-
local grantedSupportEffect = getGrantedSupportEffect(supportEffect)
165-
if grantedSupportEffect then
140+
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
166141
t_insert(activeSkill.effectList, supportEffect)
167142
if supportEffect.isSupporting and activeEffect.srcInstance then
168143
supportEffect.isSupporting[activeEffect.srcInstance] = true
169144
end
170-
if grantedSupportEffect.addFlags and not summonSkill then
145+
if supportEffect.grantedEffect.addFlags and not summonSkill then
171146
-- Support skill adds flags to supported skills (eg. Remote Mine adds 'mine')
172-
for k in pairs(grantedSupportEffect.addFlags) do
147+
for k in pairs(supportEffect.grantedEffect.addFlags) do
173148
skillFlags[k] = true
174149
end
175150
end

src/Modules/CalcSetup.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,12 +1580,8 @@ function calcs.initEnv(build, mode, override, specEnv)
15801580
for _, otherSocketGroup in ipairs(build.skillsTab.socketGroupList) do
15811581
if otherSocketGroup.slot and otherSocketGroup.slot == group.slot and not (otherSocketGroup.source and otherSocketGroup.source == group.source) then
15821582
for _, gem in ipairs(otherSocketGroup.gemList) do
1583-
if gem.gemData and gem.gemData.grantedEffectList then
1584-
for _, grantedEffect in ipairs(gem.gemData.grantedEffectList) do
1585-
if grantedEffect.support then
1586-
t_insert(group.displayGemList, gem)
1587-
end
1588-
end
1583+
if gem.gemData and gem.gemData.grantedEffect and gem.gemData.grantedEffect.support then
1584+
t_insert(group.displayGemList, gem)
15891585
end
15901586
end
15911587
end

0 commit comments

Comments
 (0)