@@ -125,14 +125,14 @@ local function setRadiusJewelStats(radiusJewel, radiusJewelStats)
125125 end
126126end
127127
128- local function addStatsFromJewelToNode (jewel , node , spec )
128+ local function addStats (jewel , node , spec )
129129 -- reset node stats to base or override for attributes
130130 if spec .hashOverrides and spec .hashOverrides [node .id ] then
131131 node .sd = copyTable (spec .hashOverrides [node .id ].sd , true )
132132 else
133133 node .sd = copyTable (spec .tree .nodes [node .id ].sd , true )
134134 end
135-
135+
136136 local radiusJewelStats = { }
137137 setRadiusJewelStats (jewel , radiusJewelStats )
138138 for _ , stat in ipairs (radiusJewelStats ) do
@@ -142,8 +142,23 @@ local function addStatsFromJewelToNode(jewel, node, spec)
142142 end
143143 end
144144 spec .tree :ProcessStats (node )
145+ return node .modList
145146end
146147
148+ local function addStatsFromJewelToNode (jewel , node , spec )
149+ local itemsTab = spec .build .itemsTab
150+ --
151+ if itemsTab .activeSocketList then
152+ for _ , nodeId in pairs (itemsTab .activeSocketList ) do
153+ local _ , socketedJewel = itemsTab :GetSocketAndJewelForNodeID (nodeId )
154+ if socketedJewel and socketedJewel .title == " Against the Darkness" then
155+ return addStats (jewel , node , spec )
156+ end
157+ end
158+ elseif itemsTab .initSockets then
159+ return addStats (jewel , node , spec )
160+ end
161+ end
147162function calcs .buildModListForNode (env , node , incSmallPassiveSkill )
148163 local modList = new (" ModList" )
149164 if node .type == " Keystone" then
@@ -175,7 +190,8 @@ function calcs.buildModListForNode(env, node, incSmallPassiveSkill)
175190 if rad .item .title ~= " Against the Darkness" then
176191 rad .func (node , modList , rad .data )
177192 else
178- addStatsFromJewelToNode (rad , node , env .build .spec )
193+ local nodeList = addStatsFromJewelToNode (rad , node , env .build .spec )
194+ if nodeList then modList = nodeList end
179195 end
180196 end
181197 end
@@ -198,11 +214,12 @@ function calcs.buildModListForNode(env, node, incSmallPassiveSkill)
198214 if rad .item .title ~= " Against the Darkness" then
199215 rad .func (node , modList , rad .data )
200216 else
201- addStatsFromJewelToNode (rad , node , env .build .spec )
217+ local nodeList = addStatsFromJewelToNode (rad , node , env .build .spec )
218+ if nodeList then modList = nodeList end
202219 end
203220 end
204221 end
205-
222+
206223 if modList :Flag (nil , " PassiveSkillHasOtherEffect" ) then
207224 for i , mod in ipairs (modList :List (skillCfg , " NodeModifier" )) do
208225 if i == 1 then wipeTable (modList ) end
0 commit comments