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

View file

@ -373,10 +373,17 @@ 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()))
{
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();
}
}
}
}
}