diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-02-20 10:54:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-20 10:54:45 +0100 |
commit | 3c70a4a83a584da1a8d0248a766b0211a8cc17f9 (patch) | |
tree | 11a45e8c59b98114cf86bad69cae5018acc20969 | |
parent | 5db6e371b3e96aff21bf406ee841732243b0c042 (diff) | |
parent | f6c59cf48d9dc61fe98651707abae782daec1858 (diff) |
Merge pull request #26080 from qarmin/fix_error_default_environment
Fix error when deleting default environment
-rw-r--r-- | editor/dependency_editor.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index f5a60f2553..f559eb6cb2 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -496,11 +496,15 @@ void DependencyRemoveDialog::ok_pressed() { res->set_path(""); } - // If the file we are deleting is the main scene, clear its definition. + // If the file we are deleting is the main scene or default environment, clear its definition. if (files_to_delete[i] == ProjectSettings::get_singleton()->get("application/run/main_scene")) { ProjectSettings::get_singleton()->set("application/run/main_scene", ""); } + if (files_to_delete[i] == ProjectSettings::get_singleton()->get("rendering/environment/default_environment")) { + ProjectSettings::get_singleton()->set("rendering/environment/default_environment", ""); + } + String path = OS::get_singleton()->get_resource_dir() + files_to_delete[i].replace_first("res://", "/"); print_verbose("Moving to trash: " + path); Error err = OS::get_singleton()->move_to_trash(path); |