FullscreenUI: Clean boot if resume picked without state

This commit is contained in:
Connor McLaughlin 2022-10-01 16:23:35 +10:00 committed by refractionpcsx2
parent ea19514b53
commit ea45025bf9
1 changed files with 3 additions and 2 deletions

View File

@ -4541,15 +4541,16 @@ void FullscreenUI::HandleGameListOptions(const GameList::Entry* entry)
{ICON_FA_WINDOW_CLOSE " Close Menu", false}, {ICON_FA_WINDOW_CLOSE " Close Menu", false},
}; };
const bool has_resume_state = VMManager::HasSaveStateInSlot(entry->serial.c_str(), entry->crc, -1);
OpenChoiceDialog( OpenChoiceDialog(
entry->title.c_str(), false, std::move(options), [entry_path = entry->path](s32 index, const std::string& title, bool checked) { entry->title.c_str(), false, std::move(options), [has_resume_state, entry_path = entry->path](s32 index, const std::string& title, bool checked) {
switch (index) switch (index)
{ {
case 0: // Open Game Properties case 0: // Open Game Properties
SwitchToGameSettings(entry_path); SwitchToGameSettings(entry_path);
break; break;
case 1: // Resume Game case 1: // Resume Game
DoStartPath(entry_path, -1); DoStartPath(entry_path, has_resume_state ? std::optional<s32>(-1) : std::optional<s32>());
break; break;
case 2: // Load State case 2: // Load State
OpenLoadStateSelectorForGame(entry_path); OpenLoadStateSelectorForGame(entry_path);