Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 1, 2025

Conversation

orbifant
Copy link
Contributor

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 in ScenarioRepository.h (variable to store guest count) is an signed value, unable to store 50k guests

@AaronVanGeffen AaronVanGeffen added the changelog This issue/PR deserves a changelog entry. label Feb 26, 2025
@orbifant
Copy link
Contributor Author

Should I fix formatting first or wait until the review?

@AaronVanGeffen
Copy link
Member

Should I fix formatting first or wait until the review?

Yes, please fix the formatting. The full CI won't run until you do.

Copy link
Member

@Gymnasiast Gymnasiast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a changelog entry.

Also, for good measure, please also modify the corresponding struct member of S6Info.

@Gymnasiast Gymnasiast added this to the v0.4.21 milestone Mar 1, 2025
@orbifant
Copy link
Contributor Author

orbifant commented Mar 1, 2025

Also, for good measure, please also modify the corresponding struct member of S6Info.

Sure. I just want to point out that I got quiet confused while tracking this one down and maybe there should also other struct members be changed, not only this one.

As seen below, at least maybe struct ScoresEntry should also be adjusted?

#scenariorepository.h (the one this PR will change)
    struct ScenarioIndexEntry
    {
        ...
        // Objective
        uint8_t ObjectiveType;
        uint8_t ObjectiveArg1;  // years
        int64_t ObjectiveArg2;  // money or excitement
        int16_t ObjectiveArg3; // guests or rideID or coasterLength
        ...
    };

#rct2.h
    struct S6Info
    {
        ...
        uint8_t ObjectiveType; // 0x02
        uint8_t ObjectiveArg1; // 0x03
        int32_t ObjectiveArg2; // 0x04
        int16_t ObjectiveArg3; // 0x08
        ...
    };

#rct2.h
    struct ScoresEntry
    {
        ....
        int8_t ObjectiveType;
        int8_t ObjectiveArg1;
        int32_t objectiveArg2;
        int16_t objectiveArg3;
        ...
    };


#scenario.h
    uint8_t Type;
    uint8_t Year;
    union
    {
        uint16_t NumGuests;
        StringId RideId;
        uint16_t MinimumLength; // For the "Build 10 coasters of minimum length" objective.
    };
    union
    {
        money64 Currency;
        ride_rating MinimumExcitement; // For the "Finish 5 coaster with a minimum excitement rating" objective.
    };

@Gymnasiast
Copy link
Member

As seen below, at least maybe struct ScoresEntry should also be adjusted?

I think you’re right.

Copy link
Member

@AaronVanGeffen AaronVanGeffen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice little change. Looks good to me!

Creating the scenario cache file tried to read the guest count as signed 16 bit value which doesnt work for values > 32k.  In addition ObjectiveArg3 (variable to store guest count) is an signed value, unable to store 50k guests
@Gymnasiast Gymnasiast merged commit e77d9c0 into OpenRCT2:develop Mar 1, 2025
23 checks passed
@orbifant orbifant deleted the fix branch March 1, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog This issue/PR deserves a changelog entry.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Park with 50k guest goal doesn't appear in the scenario list
3 participants