From 2fc4d02dd6723c40c4c3cedc5cc4d9d9fd786506 Mon Sep 17 00:00:00 2001 From: Benjamin Moir Date: Wed, 8 May 2024 18:55:42 +1000 Subject: [PATCH] SaveState: Reset VM when save state fails to load --- pcsx2/SaveState.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcsx2/SaveState.cpp b/pcsx2/SaveState.cpp index 1377fbe4ba..7c5f0bbd79 100644 --- a/pcsx2/SaveState.cpp +++ b/pcsx2/SaveState.cpp @@ -1151,6 +1151,8 @@ bool SaveState_UnzipFromDisk(const std::string& filename, Error* error) { if (!error->IsValid()) Error::SetString(error, "Save state corruption in internal structures."); + + VMManager::Reset(); return false; } @@ -1166,6 +1168,7 @@ bool SaveState_UnzipFromDisk(const std::string& filename, Error* error) if (!zff || !SavestateEntries[i]->FreezeIn(zff.get())) { Error::SetString(error, fmt::format("Save state corruption in {}.", SavestateEntries[i]->GetFilename())); + VMManager::Reset(); return false; } }