Fix -resume causing a quiet exit if there is no resume savestate

This commit is contained in:
Silent 2020-09-12 19:58:37 +02:00
parent ccaff2e7cd
commit 95d5417017
No known key found for this signature in database
GPG Key ID: AE53149BB0C45AF1
1 changed files with 9 additions and 2 deletions

View File

@ -373,10 +373,17 @@ bool CommonHostInterface::ParseCommandLineParameters(int argc, char* argv[],
{ {
state_filename = GetGameSaveStateFileName(game_code.c_str(), *state_index); state_filename = GetGameSaveStateFileName(game_code.c_str(), *state_index);
if (state_filename.empty() || !FileSystem::FileExists(state_filename.c_str())) if (state_filename.empty() || !FileSystem::FileExists(state_filename.c_str()))
{
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); Log_ErrorPrintf("Could not find file for game '%s' save state %d", game_code.c_str(), *state_index);
return false; return false;
} }
else
{
state_filename.clear();
}
}
} }
} }
} }