disconnect nodes properly when grouping

This commit is contained in:
Lera Elvoé 2023-12-05 02:01:14 +03:00
parent 464d0a0e33
commit 36ea77048b
No known key found for this signature in database

View file

@ -156,9 +156,10 @@ func group_nodes(nodes_to_group: Array) -> Deck:
var outgoing_connections := node.outgoing_connections.duplicate(true)
for from_port: int in outgoing_connections:
for connection: Dictionary in outgoing_connections[from_port]:
if !(connection.keys()[0] in node_ids_to_keep):
disconnect_nodes(node._id, connection.keys()[0], from_port, connection.values()[0])
for to_node: String in outgoing_connections[from_port]:
for to_port: int in outgoing_connections[from_port][to_node]:
if !(to_node in node_ids_to_keep):
disconnect_nodes(node._id, to_node, from_port, to_port)
var incoming_connections := node.incoming_connections.duplicate(true)