From 36ea77048b24d30f1f0887feae414f085ef8d8ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Tue, 5 Dec 2023 02:01:14 +0300 Subject: [PATCH] disconnect nodes properly when grouping --- classes/deck/deck.gd | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/deck/deck.gd b/classes/deck/deck.gd index f946253..88ca228 100644 --- a/classes/deck/deck.gd +++ b/classes/deck/deck.gd @@ -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)