You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #100787 from KoBeWi/uid_be_like_'I'm_back'
Re-create missing .uid files
This commit is contained in:
@@ -1260,11 +1260,15 @@ void EditorFileSystem::_process_file_system(const ScannedDirectory *p_scan_dir,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fi->uid == ResourceUID::INVALID_ID && ResourceLoader::exists(path) && !ResourceLoader::has_custom_uid_support(path) && !FileAccess::exists(path + ".uid")) {
|
if (ResourceLoader::exists(path) && !ResourceLoader::has_custom_uid_support(path) && !FileAccess::exists(path + ".uid")) {
|
||||||
// Create a UID.
|
// Create a UID file and new UID, if it's invalid.
|
||||||
Ref<FileAccess> f = FileAccess::open(path + ".uid", FileAccess::WRITE);
|
Ref<FileAccess> f = FileAccess::open(path + ".uid", FileAccess::WRITE);
|
||||||
if (f.is_valid()) {
|
if (f.is_valid()) {
|
||||||
|
if (fi->uid == ResourceUID::INVALID_ID) {
|
||||||
fi->uid = ResourceUID::get_singleton()->create_id();
|
fi->uid = ResourceUID::get_singleton()->create_id();
|
||||||
|
} else {
|
||||||
|
WARN_PRINT(vformat("Missing .uid file for path \"%s\". The file was re-created from cache.", path));
|
||||||
|
}
|
||||||
f->store_line(ResourceUID::get_singleton()->id_to_text(fi->uid));
|
f->store_line(ResourceUID::get_singleton()->id_to_text(fi->uid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user