mirror of
https://github.com/godotengine/godot.git
synced 2025-01-18 20:40:57 +08:00
Merge pull request #86177 from KoBeWi/depren_never_forgets
Fix file disappearing when renaming dependencies
This commit is contained in:
commit
df9be54b2f
@ -1454,8 +1454,10 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons
|
||||
fw.unref();
|
||||
|
||||
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
||||
da->remove(p_path);
|
||||
da->rename(p_path + ".depren", p_path);
|
||||
if (da->exists(p_path + ".depren")) {
|
||||
da->remove(p_path);
|
||||
da->rename(p_path + ".depren", p_path);
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
@ -1790,8 +1790,8 @@ Error ResourceFormatLoaderText::rename_dependencies(const String &p_path, const
|
||||
err = loader.rename_dependencies(f, p_path, p_map);
|
||||
}
|
||||
|
||||
if (err == OK) {
|
||||
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
||||
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
||||
if (err == OK && da->file_exists(p_path + ".depren")) {
|
||||
da->remove(p_path);
|
||||
da->rename(p_path + ".depren", p_path);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user