From 0b1d48b2fd7e25fa8842fb3a34d80c0e2c603198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Mon, 5 Apr 2021 16:11:37 +0200 Subject: [PATCH] Do not delete for now --- ReparentingDeleting/ReparentingDeleting.gd | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ReparentingDeleting/ReparentingDeleting.gd b/ReparentingDeleting/ReparentingDeleting.gd index 37b236e..361216c 100644 --- a/ReparentingDeleting/ReparentingDeleting.gd +++ b/ReparentingDeleting/ReparentingDeleting.gd @@ -60,14 +60,14 @@ func _process(delta: float) -> void: var random_node = find_node("Special Node " + str(randi() % number_of_nodes),true,false) parent_of_node.remove_child(choosen_node) - if randi() % 6 == 0: # 16% chance to remove node with children - var names_to_remove : Array = find_all_special_children_names(choosen_node) - for name_to_remove in names_to_remove: - var node : Node = ClassDB.instance(collected_nodes[randi() % collected_nodes.size()]) - node.set_name(name_to_remove) - add_child(node) - choosen_node.queue_free() - continue +# if randi() % 6 == 0: # 16% chance to remove node with children +# var names_to_remove : Array = find_all_special_children_names(choosen_node) +# for name_to_remove in names_to_remove: +# var node : Node = ClassDB.instance(collected_nodes[randi() % collected_nodes.size()]) +# node.set_name(name_to_remove) +# add_child(node) +# choosen_node.queue_free() +# continue if choosen_node.find_node(random_node.get_name(),true,false) != null: # Cannot set as node parent one of its child