Merge pull request #26643 from KoBeWi/readd_script_with_no_reselect

Fix attaching script after removing one
This commit is contained in:
Rémi Verschelde 2019-03-05 21:50:57 +01:00 committed by GitHub
commit a11d8954db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -336,9 +336,13 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
} break;
case TOOL_ATTACH_SCRIPT: {
List<Node *> selection = editor_selection->get_selected_node_list();
if (selection.empty())
break;
Node *selected = scene_tree->get_selected();
if (!selected)
break;
selected = selection.front()->get();
Ref<Script> existing = selected->get_script();