summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--editor/editor_file_system.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 3adff84e40..cdaa001d9e 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -961,6 +961,14 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, Ref<DirAc
if (fi->uid != ResourceUID::INVALID_ID) {
if (ResourceUID::get_singleton()->has_id(fi->uid)) {
+ // Restrict UID dupe warning to first-scan since we know there are no file moves going on yet.
+ if (first_scan) {
+ // Warn if we detect files with duplicate UIDs.
+ const String other_path = ResourceUID::get_singleton()->get_id_path(fi->uid);
+ if (other_path != path) {
+ WARN_PRINT(vformat("UID duplicate detected between %s and %s.", path, other_path));
+ }
+ }
ResourceUID::get_singleton()->set_id(fi->uid, path);
} else {
ResourceUID::get_singleton()->add_id(fi->uid, path);