From 3d0dc81e9e7a3694c519513822f50ecf82429143 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Wed, 6 Mar 2019 03:11:02 -0300 Subject: [PATCH] Fix clearing scripts while multiple nodes are selected (cherry picked from commit d3042d162d49a45fa288f60b6068d5e7ae4aa54f) --- editor/scene_tree_dock.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 66163d7e0ac..19b46ef90fa 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -377,7 +377,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } break; case TOOL_CLEAR_SCRIPT: { - List selection = editor_selection->get_selected_node_list(); + Array selection = editor_selection->get_selected_nodes(); if (selection.empty()) return; @@ -385,13 +385,14 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { editor_data->get_undo_redo().create_action(TTR("Clear Script")); editor_data->get_undo_redo().add_do_method(editor, "push_item", (Script *)NULL); - for (List::Element *E = selection.front(); E; E = E->next()) { + for (int i = 0; i < selection.size(); i++) { - Ref