feat(core): slightly improved crash reported restoring

This commit is contained in:
Observer KRypt0n_ 2023-06-18 08:58:22 +02:00
parent debd159704
commit 22f96831e3
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2

View file

@ -213,8 +213,15 @@ fn main() {
// Patch was renaming crash reporter to disable it // Patch was renaming crash reporter to disable it
if game_path.join("UnityCrashHandler64.exe.bak").exists() { if game_path.join("UnityCrashHandler64.exe.bak").exists() {
std::fs::remove_file(game_path.join("UnityCrashHandler64.exe.bak")) if game_path.join("UnityCrashHandler64.exe").exists() {
.expect("Failed to delete 'UnityCrashHandler64.exe.bak' file"); std::fs::remove_file(game_path.join("UnityCrashHandler64.exe.bak"))
.expect("Failed to delete 'UnityCrashHandler64.exe.bak' file");
}
else {
std::fs::rename(game_path.join("UnityCrashHandler64.exe.bak"), game_path.join("UnityCrashHandler64.exe"))
.expect("Failed to rename 'UnityCrashHandler64.exe.bak' file to 'UnityCrashHandler64.exe'");
}
} }
// End of temporary workaround ^ // End of temporary workaround ^