Merge pull request #92972 from ogapo/pr/warn-on-duplicate-uids
Editor: Warn on UID duplicates
This commit is contained in:
commit
8ba3c2aeb4
1 changed files with 8 additions and 0 deletions
|
@ -1141,6 +1141,14 @@ void EditorFileSystem::_process_file_system(const ScannedDirectory *p_scan_dir,
|
|||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue