Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix skip intro and skip first cycle logic running when it shouldn't #846

Merged

Conversation

Archez
Copy link
Contributor

@Archez Archez commented Nov 12, 2024

The Skip Intro and Skip First Cycle enhancements were running every time a save was loaded from File Select that previously used the enhancements. This is because in Sram_OpenSave the following check is performed which decides where the player should load in.

if (gSaveContext.save.isFirstCycle) {
    gSaveContext.save.entrance = ENTRANCE(SOUTH_CLOCK_TOWN, 0);
    gSaveContext.save.day = 0;
    gSaveContext.save.time = CLOCK_TIME(6, 0) - 1;
} else {
    gSaveContext.save.entrance = ENTRANCE(CUTSCENE, 0);
    gSaveContext.nextCutsceneIndex = 0;
    gSaveContext.save.playerForm = PLAYER_FORM_HUMAN;
}

What was happening is that save.isFirstCycle was not properly set by our enhancements, which meant the intro cutscene entrance is set, triggering our enhancements over and over.

This save.isFirstCycle is poorly named, it doesn't mean "currently in the first cycle", rather it means "link has entered clock town at least once". Basically it is just set once the game auto saves after entering clock town for the first time.

I've reworked both enhancements to bail out early if this flag is already set, and made it so the Skip Intro portion correctly sets the flag, while removing an incorrect unsetting of this flag in the Skip First Cycle portion.

Also removed needless conditional checks for setting flags since the operations will only run once.

Build Artifacts

Copy link
Contributor

@garrettjoecox garrettjoecox left a comment

Choose a reason for hiding this comment

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

Good find. Also ran into some hiccups from that bit in sram_opensave yesterday lol

@Archez Archez merged commit cf92349 into HarbourMasters:develop-satoko Nov 12, 2024
5 checks passed
@Archez Archez deleted the fix-skip-intro-first-cycle branch November 12, 2024 16:00
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants