Merge pull request #85922 from Listwon/fix-uid-corruption-on-reimport-80132

Prevent overriding file info of another file when reimport creates extra files
This commit is contained in:
Rémi Verschelde 2023-12-12 00:33:25 +01:00
commit e551672c2d
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 3 additions and 0 deletions

View File

@ -2154,6 +2154,9 @@ Error EditorFileSystem::_reimport_file(const String &p_file, const HashMap<Strin
} }
} }
// Update cpos, newly created files could've changed the index of the reimported p_file.
_find_file(p_file, &fs, cpos);
//update modified times, to avoid reimport //update modified times, to avoid reimport
fs->files[cpos]->modified_time = FileAccess::get_modified_time(p_file); fs->files[cpos]->modified_time = FileAccess::get_modified_time(p_file);
fs->files[cpos]->import_modified_time = FileAccess::get_modified_time(p_file + ".import"); fs->files[cpos]->import_modified_time = FileAccess::get_modified_time(p_file + ".import");