diff --git a/soh/soh/Enhancements/debugconsole.cpp b/soh/soh/Enhancements/debugconsole.cpp index 3e61505b2..88a23718e 100644 --- a/soh/soh/Enhancements/debugconsole.cpp +++ b/soh/soh/Enhancements/debugconsole.cpp @@ -207,6 +207,7 @@ static bool ResetHandler(std::shared_ptr Console, std::vectorgameplayFrames = 0; SET_NEXT_GAMESTATE(&gPlayState->state, TitleSetup_Init, GameState); gPlayState->state.running = false; GameInteractor::Instance->ExecuteHooks(gSaveContext.fileNum); diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 841de8f13..59a5d0619 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -33,6 +33,7 @@ u64 D_801614D0[0xA00]; #endif PlayState* gPlayState; +s16 firstInit = 0; s16 gEnPartnerId; @@ -490,6 +491,12 @@ void Play_Init(GameState* thisx) { } } + // Properly initialize the frame counter so it doesn't use garbage data + if (!firstInit) { + play->gameplayFrames = 0; + firstInit = 1; + } + // Invalid entrance, so immediately exit the game to opening title if (gSaveContext.entranceIndex == -1) { gSaveContext.entranceIndex = 0; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 55a5075a6..35490f079 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -4290,6 +4290,8 @@ void KaleidoScope_Update(PlayState* play) if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { Grotto_ForceGrottoReturn(); } + // Reset frame counter to prevent autosave on respawn + play->gameplayFrames = 0; gSaveContext.nextTransitionType = 2; gSaveContext.health = CVarGetInteger("gFullHealthSpawn", 0) ? gSaveContext.healthCapacity : 0x30; Audio_QueueSeqCmd(0xF << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xA);