Ver Fonte

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

Jonathan Higgins há 2 meses atrás
pai
commit
9e6daa780d
1 ficheiros alterados com 3 adições e 0 exclusões
  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