Merge pull request #1589 from MostafaHassan/pr_NoSelection_AddNodeToRoot

New node will be added to root node if nothing is selected
This commit is contained in:
Juan Linietsky 2015-03-31 15:38:50 -03:00
commit 4883e2e887

View file

@ -1059,14 +1059,15 @@ void SceneTreeDock::_create() {
if (edited_scene) {
// If root exists in edited scene
parent = scene_tree->get_selected();
ERR_FAIL_COND(!parent);
} else {
if( !parent )
parent = edited_scene;
} else {
// If no root exist in edited scene
parent = scene_root;
ERR_FAIL_COND(!parent);
}
Object *c = create_dialog->instance_selected();