mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
Savestates: Don't actually delete savestates
This commit is contained in:
parent
a604394b20
commit
4445569bb0
1 changed files with 15 additions and 1 deletions
|
@ -678,7 +678,13 @@ game_boot_result Emulator::BootGame(const std::string& path, const std::string&
|
||||||
|
|
||||||
if (g_cfg.savestate.suspend_emu && m_ar)
|
if (g_cfg.savestate.suspend_emu && m_ar)
|
||||||
{
|
{
|
||||||
fs::remove_file(path);
|
std::string old_path = path.substr(0, path.find_last_not_of(fs::delim));
|
||||||
|
old_path.insert(old_path.find_last_of(fs::delim) + 1, "old-"sv);
|
||||||
|
|
||||||
|
if (fs::rename(path, old_path, true))
|
||||||
|
{
|
||||||
|
sys_log.notice("Savestate has been moved to path='%s'", old_path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
@ -2532,6 +2538,14 @@ std::shared_ptr<utils::serial> Emulator::Kill(bool allow_autoexit, bool savestat
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
std::string old_path = path.substr(0, path.find_last_not_of(fs::delim));
|
||||||
|
old_path.insert(old_path.find_last_of(fs::delim) + 1, "old-"sv);
|
||||||
|
|
||||||
|
if (fs::remove_file(old_path))
|
||||||
|
{
|
||||||
|
sys_log.success("Old savestate has been removed: path='%s'", old_path);
|
||||||
|
}
|
||||||
|
|
||||||
sys_log.success("Saved savestate! path='%s'", path);
|
sys_log.success("Saved savestate! path='%s'", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue