Skip to content

Commit

Permalink
Savestate crash fix on Ubuntu (#843)
Browse files Browse the repository at this point in the history
  • Loading branch information
lilacLunatic authored Jul 21, 2022
1 parent dfa929a commit e41873f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions soh/soh/Enhancements/savestates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,21 +869,19 @@ SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) {
switch (request.type) {
case RequestType::SAVE:
requests.push(request);
break;
return SaveStateReturn::SUCCESS;
case RequestType::LOAD:
if (states.contains(request.slot)) {
requests.push(request);
return SaveStateReturn::SUCCESS;
} else {
SPDLOG_ERROR("Invalid SaveState slot: {}", request.type);
SohImGui::overlay->TextDrawNotification(1.0f, true, "state slot %u empty", request.slot);
return SaveStateReturn::FAIL_INVALID_SLOT;
}
break;
[[unlikely]] default:
SPDLOG_ERROR("Invalid SaveState request type: {}", request.type);
return SaveStateReturn::FAIL_BAD_REQUEST;
break;

}
}

Expand Down

0 comments on commit e41873f

Please sign in to comment.