diff --git a/spec/System/TestRadiusJewelStatDiff_spec.lua b/spec/System/TestRadiusJewelStatDiff_spec.lua index 0fd2fa03894..b206c6b8f54 100644 --- a/spec/System/TestRadiusJewelStatDiff_spec.lua +++ b/spec/System/TestRadiusJewelStatDiff_spec.lua @@ -582,6 +582,29 @@ describe("TestRadiusJewelStatDiff", function() assert.is_truthy(calcFunc(override), "calcFunc with removeNodes should return output") end) + it("custom Impossible Escape without a radius or with an unknown keystone does nothing", function() + local spec, socketNode = setupAllocatedSocket() + local function customJewel(keystoneName, radiusLine) + return new("Item"):Item("Rarity: RARE\n" .. + "Custom Escape\n" .. + "Cobalt Jewel\n" .. + (radiusLine or "") .. + "Implicits: 0\n" .. + "Passive Skills in radius of " .. keystoneName .. " can be allocated without being connected to your tree\n") + end + + for _, item in ipairs({ + customJewel("Iron Reflexes"), + customJewel("Not A Keystone", "Radius: Small\n"), + }) do + assert.is_truthy(item.jewelData.impossibleEscapeKeystone) + equipJewelInSocket(item, socketNode) + spec:BuildAllDependsAndPaths() + runCallback("OnFrame") + assert.are.same({ }, spec:NodesInIntuitiveLeapLikeRadius(spec.nodes[socketNode.id])) + end + end) + it("AddItemTooltip emits a remove-comparison block for an equipped Timeless jewel", function() local spec, socketNode = setupAllocatedSocket() diff --git a/src/Classes/PassiveSpec.lua b/src/Classes/PassiveSpec.lua index 89dd9e754a1..18f952301aa 100644 --- a/src/Classes/PassiveSpec.lua +++ b/src/Classes/PassiveSpec.lua @@ -1097,9 +1097,12 @@ function PassiveSpecClass:NodesInIntuitiveLeapLikeRadius(node) end if item.jewelData and item.jewelData.impossibleEscapeKeystone then - for keyName, keyNode in pairs(item.jewelData.impossibleEscapeKeystones) do - if self.tree.keystoneMap[keyName] and self.tree.keystoneMap[keyName].nodesInRadius then - for affectedNodeId in pairs(self.tree.keystoneMap[keyName].nodesInRadius[radiusIndex]) do + for keyName in pairs(item.jewelData.impossibleEscapeKeystones) do + local keyNode = self.tree.keystoneMap[keyName] + -- A custom jewel can lack a radius, and a keystone missing from the tree has no radius data + local inRadius = keyNode and keyNode.nodesInRadius and keyNode.nodesInRadius[radiusIndex] + if inRadius then + for affectedNodeId in pairs(inRadius) do if self.nodes[affectedNodeId].alloc then t_insert(result, self.nodes[affectedNodeId]) end