Skip to content

Start splitting Location List into ShipInit functions#5011

Merged
Malkierian merged 7 commits intoHarbourMasters:developfrom
leggettc18:location_list_split
Feb 7, 2025
Merged

Start splitting Location List into ShipInit functions#5011
Malkierian merged 7 commits intoHarbourMasters:developfrom
leggettc18:location_list_split

Conversation

@leggettc18
Copy link
Contributor

@leggettc18 leggettc18 commented Feb 6, 2025

InitLocationList was getting so big that the PRs for Grass and Crate shuffle would crash in Debug Mode due to a StackOverflow. Combining the two would cause a crash even in Release mode. Splitting InitLocationList into multiple functions was the Impetus for this PR, and while I was splitting it up anyway I opted to make use of ShipInit for this. New types of checks should use this pattern and eventually we should find a place for the other types of checks to use this pattern (Skulls, Frogs, Chests?, etc.). For now InitLocationList still exists but it only has the older checks and should never be added to. If anything efforts should be made to move the remaining checks out.

Build Artifacts

SohGui::SetupGuiElements();
ShipInit::InitAll();

Rando::StaticData::InitHashMaps();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Rando::StaticData::InitHashMaps();
Rando::StaticData::InitHashMaps();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

??? I'm not understanding why the space? That make it misaligned with the line directly above it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh weird I looked at it on a different page and now I see it looks misaligned. I'll have a closer look tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fixed now

Copy link
Contributor

@briaguya0 briaguya0 left a comment

Choose a reason for hiding this comment

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

it's awesome seeing giant files split up! thanks for doing this!

@Malkierian
Copy link
Contributor

Just one question, has this been tested with a number of extra locations that would have exhibited the overflow issue?

@leggettc18
Copy link
Contributor Author

Not in this exact permutation, but I have confirmed with Spoon that when crates were crashing on Debug builds, moving them to a separate function did prevent the crash. We can ask Spoon or serprex to rebase onto this and adopt this pattern if we want to be super sure.

Copy link
Contributor

@Malkierian Malkierian left a comment

Choose a reason for hiding this comment

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

Nah, that's good enough for me. We can fine-tune it if necessary later. Rather get this into develop for them than have them have to rebase back and forth.

@Malkierian Malkierian merged commit 2400ad1 into HarbourMasters:develop Feb 7, 2025
5 checks passed
@leggettc18 leggettc18 deleted the location_list_split branch February 7, 2025 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants