diff --git a/editor/docks/scene_tree_dock.cpp b/editor/docks/scene_tree_dock.cpp index 96de0a90063..2338d4ae30e 100644 --- a/editor/docks/scene_tree_dock.cpp +++ b/editor/docks/scene_tree_dock.cpp @@ -563,7 +563,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (!profile_allow_editing) { break; } - if (editor_selection->get_top_selected_node_list().size() > 1) { + if (editor_selection->get_selection().size() > 1) { if (!_validate_no_foreign()) { break; } @@ -1153,7 +1153,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { break; } - List selection = editor_selection->get_top_selected_node_list(); + const List &selection = editor_selection->get_top_selected_node_list(); if (selection.size() != 1) { accept->set_text(vformat(TTR("Saving the branch as a scene requires selecting only one node, but you have selected %d nodes."), selection.size())); @@ -1214,8 +1214,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { new_scene_from_dialog->popup_file_dialog(); } break; case TOOL_COPY_NODE_PATH: { - List selection = editor_selection->get_top_selected_node_list(); - List::Element *e = selection.front(); + const List &selection = editor_selection->get_top_selected_node_list(); + const List::Element *e = selection.front(); if (e) { Node *node = e->get(); if (node) { @@ -1226,8 +1226,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } } break; case TOOL_SHOW_IN_FILE_SYSTEM: { - List selection = editor_selection->get_top_selected_node_list(); - List::Element *e = selection.front(); + const List &selection = editor_selection->get_top_selected_node_list(); + const List::Element *e = selection.front(); if (e) { const Node *node = e->get(); if (node) { @@ -1236,7 +1236,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } } break; case TOOL_OPEN_DOCUMENTATION: { - List selection = editor_selection->get_top_selected_node_list(); + const List &selection = editor_selection->get_top_selected_node_list(); for (const Node *node : selection) { String class_name; Ref