Fix crash with graphics menu index out of bounds (#738)

This commit is contained in:
Archez 2024-07-08 23:47:42 -04:00 committed by GitHub
parent 2bb149b367
commit 5984bdea19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -16,7 +16,7 @@ If you're having any trouble after reading through this `README`, feel free ask
### 1. Verify your ROM dump ### 1. Verify your ROM dump
You can verify you have dumped a supported copy of the game by using the compatibility checker at https://2ship.equipment/. If you'd prefer to manually validate your ROM dump, you can cross-reference its `sha1` hash with the hashes [here](docs/supportedHashes.json). You can verify you have dumped a supported copy of the game by using the compatibility checker at https://2ship.equipment/. If you'd prefer to manually validate your ROM dump, you can cross-reference its `sha1` hash with the hashes [here](docs/supportedHashes.json).
### 2. Download The Ship of Harkinian from [Releases](https://github.com/HarbourMasters/2Ship2Harkinian/releases) ### 2. Download 2 Ship 2 Harkinian from [Releases](https://github.com/HarbourMasters/2Ship2Harkinian/releases)
### 3. Launch the Game! ### 3. Launch the Game!
#### Windows #### Windows

View File

@ -62,7 +62,6 @@ Ship::WindowBackend configWindowBackend;
void UpdateWindowBackendObjects() { void UpdateWindowBackendObjects() {
Ship::WindowBackend runningWindowBackend = Ship::Context::GetInstance()->GetWindow()->GetWindowBackend(); Ship::WindowBackend runningWindowBackend = Ship::Context::GetInstance()->GetWindow()->GetWindowBackend();
Ship::WindowBackend configWindowBackend;
int32_t configWindowBackendId = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1); int32_t configWindowBackendId = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1);
if (configWindowBackendId != -1 && configWindowBackendId < static_cast<int>(Ship::WindowBackend::BACKEND_COUNT)) { if (configWindowBackendId != -1 && configWindowBackendId < static_cast<int>(Ship::WindowBackend::BACKEND_COUNT)) {
configWindowBackend = static_cast<Ship::WindowBackend>(configWindowBackendId); configWindowBackend = static_cast<Ship::WindowBackend>(configWindowBackendId);