HostInterface: Don't try to resume system without game code

pull/211/head
Connor McLaughlin 6 years ago
parent 6efcf2d912
commit dcc9da3f5e

@ -487,22 +487,33 @@ bool HostInterface::ResumeSystemFromState(const char* filename, bool boot_on_fai
return false; return false;
const bool global = m_system->GetRunningCode().empty(); const bool global = m_system->GetRunningCode().empty();
const std::string path = if (m_system->GetRunningCode().empty())
global ? GetGlobalSaveStateFileName(-1) : GetGameSaveStateFileName(m_system->GetRunningCode().c_str(), -1);
if (FileSystem::FileExists(path.c_str()))
{ {
if (!LoadState(path.c_str()) && !boot_on_failure) ReportFormattedError("Cannot resume system with undetectable game code from '%s'.", filename);
if (!boot_on_failure)
{ {
DestroySystem(); DestroySystem();
return false; return true;
} }
} }
else if (!boot_on_failure) else
{ {
ReportFormattedError("Resume save state not found for '%s' ('%s').", m_system->GetRunningCode().c_str(), const std::string path = GetGameSaveStateFileName(m_system->GetRunningCode().c_str(), -1);
m_system->GetRunningTitle().c_str()); if (FileSystem::FileExists(path.c_str()))
DestroySystem(); {
return false; if (!LoadState(path.c_str()) && !boot_on_failure)
{
DestroySystem();
return false;
}
}
else if (!boot_on_failure)
{
ReportFormattedError("Resume save state not found for '%s' ('%s').", m_system->GetRunningCode().c_str(),
m_system->GetRunningTitle().c_str());
DestroySystem();
return false;
}
} }
return true; return true;

Loading…
Cancel
Save