Skip to content

Commit 3f42ffd

Browse files
committed
Fix allocation for far nodes
1 parent 5651e62 commit 3f42ffd

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

src/Classes/PassiveTreeView.lua

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,9 +1491,29 @@ function PassiveTreeViewClass:CanReachFromCurrentWeaponSet(node, spec)
14911491
return true -- Already allocated nodes don't need path checking
14921492
end
14931493

1494-
-- Check if any directly linked allocated node belongs to current weapon set or main tree
1495-
local canReachFromCurrentSet = false
1494+
-- Check the calculated path if it exists
1495+
if node.path and #node.path > 1 then
1496+
local foundCompatibleAllocated = false
1497+
1498+
-- node.path[1] is the target node itself, start from index 2
1499+
for i = 2, #node.path do
1500+
local pathNode = node.path[i]
14961501

1502+
if pathNode.alloc then
1503+
-- Found an allocated node in the path
1504+
if pathNode.allocMode == spec.allocMode or pathNode.allocMode == 0 then
1505+
foundCompatibleAllocated = true
1506+
else
1507+
return false
1508+
end
1509+
end
1510+
end
1511+
1512+
return true
1513+
end
1514+
1515+
-- Fallback: check directly linked allocated nodes (for edge cases)
1516+
local canReachFromCurrentSet = false
14971517
if node.linked then
14981518
for _, linkedNode in ipairs(node.linked) do
14991519
if linkedNode.alloc then

0 commit comments

Comments
 (0)