@@ -1337,7 +1337,9 @@ function PassiveSpecClass:BuildClusterJewelGraphs()
13371337 node .alloc = true
13381338 if not self .allocNodes [nodeId ] then
13391339 self .allocNodes [nodeId ] = node
1340- t_insert (self .allocExtendedNodes , nodeId )
1340+ if not isValueInArray (self .allocExtendedNodes , nodeId ) then
1341+ t_insert (self .allocExtendedNodes , nodeId )
1342+ end
13411343 end
13421344 end
13431345 end
@@ -1427,6 +1429,10 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe
14271429 end
14281430
14291431 local function addToAllocatedSubgraphNodes (node )
1432+ -- Don't add to allocSubgraphNodes if node already exists
1433+ if isValueInArray (self .allocSubgraphNodes , node .id ) then
1434+ return false
1435+ end
14301436 local proxyGroup = matchGroup (expansionJewel .proxy )
14311437 if proxyGroup then
14321438 for id , data in pairs (importedNodes ) do
@@ -1473,7 +1479,6 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe
14731479 self .nodes [node .id ] = node
14741480 if addToAllocatedSubgraphNodes (node ) then
14751481 t_insert (self .allocSubgraphNodes , node .id )
1476- t_insert (self .allocExtendedNodes , node .id )
14771482 end
14781483 return
14791484 end
@@ -1488,21 +1493,6 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe
14881493 end
14891494 end
14901495
1491- -- Check if we need to downsize the group
1492- local groupSize = expansionJewel .size
1493- upSize = upSize or 0
1494- while clusterJewel .sizeIndex < groupSize do
1495- -- Look for the socket with index 1 first (middle socket of large groups), then index 0
1496- local socket = findSocket (proxyGroup , 1 ) or findSocket (proxyGroup , 0 )
1497- assert (socket , " Downsizing socket not found" )
1498-
1499- -- Grab the proxy node/group from the socket
1500- proxyNode = self .tree .nodes [tonumber (socket .expansionJewel .proxy )]
1501- proxyGroup = proxyNode .group
1502- groupSize = socket .expansionJewel .size
1503- upSize = upSize + 1
1504- end
1505-
15061496 -- Initialise orbit flags
15071497 local nodeOrbit = clusterJewel .sizeIndex + 1
15081498 subGraph .group .oo [nodeOrbit ] = true
@@ -1714,13 +1704,14 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe
17141704 return m_floor (srcOidx * destNodesPerOrbit / srcNodesPerOrbit )
17151705 end
17161706 end
1717- local proxyNodeSkillsPerOrbit = self .tree .skillsPerOrbit [proxyNode .o + 1 ]
1718-
1707+
1708+ local skillsPerOrbit = self .tree .skillsPerOrbit [clusterJewel .sizeIndex + 2 ]
1709+ local startOidx = data .clusterJewels .orbitOffsets [proxyNode .id ][clusterJewel .sizeIndex ]
17191710 -- Translate oidx positioning to TreeData-relative values
17201711 for _ , node in pairs (indicies ) do
1721- local proxyNodeOidxRelativeToClusterIndicies = translateOidx (proxyNode . oidx , proxyNodeSkillsPerOrbit , clusterJewel .totalIndicies )
1722- local correctedNodeOidxRelativeToClusterIndicies = (node .oidx + proxyNodeOidxRelativeToClusterIndicies ) % clusterJewel .totalIndicies
1723- local correctedNodeOidxRelativeToTreeSkillsPerOrbit = translateOidx (correctedNodeOidxRelativeToClusterIndicies , clusterJewel .totalIndicies , proxyNodeSkillsPerOrbit )
1712+ local startOidxRelativeToClusterIndicies = translateOidx (startOidx , skillsPerOrbit , clusterJewel .totalIndicies )
1713+ local correctedNodeOidxRelativeToClusterIndicies = (node .oidx + startOidx ) % clusterJewel .totalIndicies
1714+ local correctedNodeOidxRelativeToTreeSkillsPerOrbit = translateOidx (correctedNodeOidxRelativeToClusterIndicies , clusterJewel .totalIndicies , skillsPerOrbit )
17241715 node .oidx = correctedNodeOidxRelativeToTreeSkillsPerOrbit
17251716 end
17261717
0 commit comments