Browse Source

fix for pressing delete with nothing selected clogging up the undo redo queue

Jonathan Higgins 2 months ago
parent
commit
9e6daa780d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      scenes/main/scripts/graph_edit.gd

+ 3 - 0
scenes/main/scripts/graph_edit.gd

@@ -405,6 +405,9 @@ func _unhandled_key_input(event: InputEvent) -> void:
 			pass
 
 func _on_graph_edit_delete_nodes_request(nodes: Array[StringName]) -> void:
+	if nodes.size() == 0:
+		return
+	
 	control_script.undo_redo.create_action("Delete Nodes")
 	
 	#Collect node data for undo