From 41d0486ad12e6d2abe1b8fca239eb10d1c66b749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20K=C5=99=C3=AD=C5=BE?= Date: Wed, 6 Apr 2022 22:38:16 +0200 Subject: [PATCH] Fix missing favorite files in filesystem dock (cherry picked from commit cbe363d7161d765577e9babf22a2d6f158b6259a) --- editor/filesystem_dock.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 5f1bcab7ac6..b0afd3fca3b 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -223,10 +223,11 @@ void FileSystemDock::_update_tree(const Vector &p_uncollapsed_paths, boo DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES); bool fav_changed = false; for (int i = favorite_paths.size() - 1; i >= 0; i--) { - if (!da->dir_exists(favorite_paths[i])) { - favorite_paths.remove(i); - fav_changed = true; + if (da->dir_exists(favorite_paths[i]) || da->file_exists(favorite_paths[i])) { + continue; } + favorite_paths.remove(i); + fav_changed = true; } if (fav_changed) { EditorSettings::get_singleton()->set_favorites(favorite_paths);