summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorNathan Warden <nathanwardenlee@icloud.com>2015-01-20 09:05:22 -0500
committerNathan Warden <nathanwardenlee@icloud.com>2015-01-20 09:05:22 -0500
commit0e8987abaf898db74b8b0278effd305673935d5e (patch)
tree8dc7ce374accdb878083ebd358733a04e6e3c85e /tools/editor
parent92cc7b840eff99e90b64caad6883aefbe4c3dd1e (diff)
Fixed a bug where if a scene hadn't been saved it would find a cyclical dependency.
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/scene_tree_dock.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index d8d713ee40..6f33d4b3d1 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -83,12 +83,16 @@ Node* SceneTreeDock::instance(const String& p_file) {
return NULL;
}
- if (_cyclical_dependency_exists(edited_scene->get_filename(), instanced_scene)) {
+ // If the scene hasn't been saved yet a cyclical dependency cannot exist.
+ if (edited_scene->get_filename()!="") {
- accept->get_ok()->set_text("Ok");
- accept->set_text(String("Cannot instance the scene '")+p_file+String("' because the current scene exists within one of its' nodes."));
- accept->popup_centered(Size2(300,90));
- return NULL;
+ if (_cyclical_dependency_exists(edited_scene->get_filename(), instanced_scene)) {
+
+ accept->get_ok()->set_text("Ok");
+ accept->set_text(String("Cannot instance the scene '")+p_file+String("' because the current scene exists within one of its' nodes."));
+ accept->popup_centered(Size2(300,90));
+ return NULL;
+ }
}
instanced_scene->generate_instance_state();