From 95d54170176086dbf710a0399d36661b634740d0 Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 12 Sep 2020 19:58:37 +0200 Subject: [PATCH] Fix -resume causing a quiet exit if there is no resume savestate --- src/frontend-common/common_host_interface.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index 8df599450..7a24d5ec9 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -374,8 +374,15 @@ bool CommonHostInterface::ParseCommandLineParameters(int argc, char* argv[], state_filename = GetGameSaveStateFileName(game_code.c_str(), *state_index); if (state_filename.empty() || !FileSystem::FileExists(state_filename.c_str())) { - Log_ErrorPrintf("Could not find file for game '%s' save state %d", game_code.c_str(), *state_index); - return false; + if (state_index >= 0) // Do not exit if -resume is specified, but resume save state does not exist + { + Log_ErrorPrintf("Could not find file for game '%s' save state %d", game_code.c_str(), *state_index); + return false; + } + else + { + state_filename.clear(); + } } } }