diff --git a/spec/System/TestItemMods_spec.lua b/spec/System/TestItemMods_spec.lua index b15074c41..1ad118a69 100644 --- a/spec/System/TestItemMods_spec.lua +++ b/spec/System/TestItemMods_spec.lua @@ -552,4 +552,38 @@ describe("TetsItemMods", function() assert.are_not.equals(baseColdAvg, round(build.calcsTab.mainOutput.ColdStoredCombinedAvg)) assert.equals(0, round(build.calcsTab.mainOutput.FireStoredCombinedAvg)) end) + + it("does not grant attributes from disconnected radius-allocated attribute passives", function() + local function makeAttributeNode(connectedToStart) + local node = { + id = 1, + type = "Normal", + isAttribute = true, + connectedToStart = connectedToStart, + intuitiveLeapLikesAffecting = { { id = 100 } }, + modList = new("ModList"), + allocMode = 0, + } + node.modList:NewMod("Int", "BASE", 5, "Tree:1") + return node + end + + local disconnectedNode = makeAttributeNode(false) + local env = { + mode = "MAIN", + radiusJewelList = { }, + allocNodes = { + [disconnectedNode.id] = disconnectedNode, + }, + } + + assert.are.equals(0, build.calcsTab.calcs.buildModListForNode(env, disconnectedNode, 0):Sum("BASE", nil, "Int")) + + local connectedNode = makeAttributeNode(true) + env.allocNodes = { + [connectedNode.id] = connectedNode, + } + + assert.are.equals(5, build.calcsTab.calcs.buildModListForNode(env, connectedNode, 0):Sum("BASE", nil, "Int")) + end) end) diff --git a/src/Modules/CalcSetup.lua b/src/Modules/CalcSetup.lua index 5e24c1339..4f66900ef 100644 --- a/src/Modules/CalcSetup.lua +++ b/src/Modules/CalcSetup.lua @@ -117,6 +117,10 @@ local function refreshJewelStatCache(env) end end +local function attributeNodeAllocatedByDisconnectedRadius(node) + return node.isAttribute and not node.connectedToStart and node.intuitiveLeapLikesAffecting and #node.intuitiveLeapLikesAffecting > 0 +end + function calcs.buildModListForNode(env, node, incSmallPassiveSkill, includeKeystoneMods) local localSmallIncEffect = 0 local localNotableIncEffect = 0 @@ -128,6 +132,9 @@ function calcs.buildModListForNode(env, node, incSmallPassiveSkill, includeKeyst if node.keystoneMod then modList:AddMod(node.keystoneMod) end + elseif attributeNodeAllocatedByDisconnectedRadius(node) then + -- PoE2 currently does not grant the Str/Dex/Int from attribute passives + -- allocated only through "can be Allocated without being connected" radius effects. else modList:AddList(node.modList) end