[VFS] Fixed allow_game_relative_writes to write invalid cached entries
This PR fixes https://github.com/xenia-canary/xenia-canary/issues/123 a bug where files would not write to the host if they were deleted from the host filesystem during runtime.
This commit is contained in:
@@ -103,9 +103,10 @@ bool HostPathEntry::DeleteEntryInternal(Entry* entry) {
|
||||
auto removed = std::filesystem::remove_all(full_path, ec);
|
||||
return removed >= 1 && removed != static_cast<std::uintmax_t>(-1);
|
||||
} else {
|
||||
// Delete file.
|
||||
// Delete file only if it exists.
|
||||
return !std::filesystem::is_directory(full_path) &&
|
||||
std::filesystem::remove(full_path, ec);
|
||||
(!std::filesystem::exists(full_path) ||
|
||||
std::filesystem::remove(full_path, ec));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user