Savestate crash fix on Ubuntu (#843)

This commit is contained in:
RaelCappra 2022-07-21 19:34:04 -03:00 committed by GitHub
parent dfa929a16f
commit e41873fff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
}