1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 16:24:35 +01:00

Fix #23743: Park with > 32k guests goal not in scenario list

Creating the scenario cache file tried to read the guest count as signed 16 bit value which doesn't work for values > 32k.  In addition ObjectiveArg3 (variable to store guest count) is an signed value, unable to store 50k guests.
This commit is contained in:
orbifant
2025-03-01 20:51:10 +01:00
committed by GitHub
parent f6e80d1efc
commit e77d9c0c30
4 changed files with 12 additions and 10 deletions

View File

@@ -2,6 +2,7 @@
------------------------------------------------------------------------
- Fix: [#4225] Ride Construction window offers non-existent banked sloped to level curve (original bug).
- Fix: [#10379] Banners outside the park can be renamed and modified (original bug).
- Fix: [#23743] Parks with guest goals over 32767 do not appear in the scenario list.
- Fix: [#23844] Sound effects keep playing when loading another save.
- Fix: [#23897] Reverse Freefall Coaster slope up to vertical track piece does not draw a vertical tunnel.

View File

@@ -224,9 +224,10 @@ namespace OpenRCT2
ReadWriteStringTable(cs, scenarioDetails, "en-GB");
entry.Details = scenarioDetails;
// wrong order is intentional here due to ReadWriteScenarioChunk writing guests first
entry.ObjectiveType = cs.Read<uint8_t>();
entry.ObjectiveArg1 = cs.Read<uint8_t>();
entry.ObjectiveArg3 = cs.Read<int16_t>();
entry.ObjectiveArg3 = cs.Read<uint16_t>();
entry.ObjectiveArg2 = cs.Read<int32_t>();
entry.SourceGame = ScenarioSource::Other;

View File

@@ -393,7 +393,7 @@ namespace OpenRCT2::RCT2
int8_t ObjectiveType;
int8_t ObjectiveArg1;
int32_t objectiveArg2;
int16_t objectiveArg3;
uint16_t objectiveArg3;
char Name[64];
char Details[256];
int32_t Flags;
@@ -758,11 +758,11 @@ namespace OpenRCT2::RCT2
struct S6Info
{
::EditorStep EditorStep;
uint8_t Category; // 0x01
uint8_t ObjectiveType; // 0x02
uint8_t ObjectiveArg1; // 0x03
int32_t ObjectiveArg2; // 0x04
int16_t ObjectiveArg3; // 0x08
uint8_t Category; // 0x01
uint8_t ObjectiveType; // 0x02
uint8_t ObjectiveArg1; // 0x03
int32_t ObjectiveArg2; // 0x04
uint16_t ObjectiveArg3; // 0x08
uint8_t Pad00A[0x3E];
char Name[64]; // 0x48
char Details[256]; // 0x88

View File

@@ -52,9 +52,9 @@ struct ScenarioIndexEntry
// Objective
uint8_t ObjectiveType;
uint8_t ObjectiveArg1;
int64_t ObjectiveArg2;
int16_t ObjectiveArg3;
uint8_t ObjectiveArg1; // years
int64_t ObjectiveArg2; // money or excitement
uint16_t ObjectiveArg3; // guests or rideID or coasterLength
ScenarioHighscoreEntry* Highscore = nullptr;
u8string InternalName; // Untranslated name