From f4ff30dff0468880c6b36c347e83ebacb9db2d5e Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 9 Jun 2016 21:43:28 -0300 Subject: If a resource is delete from fs dialog, but the resource is currently loaded, clear the path of the resource. Fixes #5110 --- tools/editor/dependency_editor.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools/editor/dependency_editor.cpp') diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp index a702d3c68..6ad770481 100644 --- a/tools/editor/dependency_editor.cpp +++ b/tools/editor/dependency_editor.cpp @@ -399,6 +399,7 @@ void DependencyRemoveDialog::show(const Vector &to_erase) { _fill_owners(EditorFileSystem::get_singleton()->get_filesystem()); + if (exist) { owners->show(); text->set_text(TTR("The files being removed are required by other resources in order for them to work.\nRemove them anyway? (no undo)")); @@ -417,6 +418,10 @@ void DependencyRemoveDialog::ok_pressed() { DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); for (Map::Element *E=files.front();E;E=E->next()) { + if (ResourceCache::has(E->key())) { + Resource *res = ResourceCache::get(E->key()); + res->set_path(""); //clear reference to path + } da->remove(E->key()); EditorFileSystem::get_singleton()->update_file(E->key()); } -- cgit v1.2.3-70-g09d2