Jelajahi Sumber

Merge pull request #18587 from AlexHoratio/master

Defaults to instancing child at tree root when none selected
Max Hilbrunner 7 tahun lalu
induk
melakukan
9b0c487dd4
1 mengubah file dengan 6 tambahan dan 1 penghapusan
  1. 6 1
      editor/scene_tree_dock.cpp

+ 6 - 1
editor/scene_tree_dock.cpp

@@ -107,7 +107,12 @@ void SceneTreeDock::_unhandled_key_input(Ref<InputEvent> p_event) {
 void SceneTreeDock::instance(const String &p_file) {
 void SceneTreeDock::instance(const String &p_file) {
 
 
 	Node *parent = scene_tree->get_selected();
 	Node *parent = scene_tree->get_selected();
-	if (!parent || !edited_scene) {
+
+	if (!parent) {
+		Node *parent = edited_scene;
+	};
+
+	if (!edited_scene) {
 
 
 		current_option = -1;
 		current_option = -1;
 		accept->get_ok()->set_text(TTR("OK :("));
 		accept->get_ok()->set_text(TTR("OK :("));