From b0510d78f81a00e7b88d2110339d8592007c9ed4 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Mon, 10 Oct 2022 03:16:40 -0500 Subject: [PATCH] [#1712] Reset fileNum when returning to title screen and prevent saving when file = 0xFF (#1721) --- soh/src/code/z_play.c | 2 +- soh/src/overlays/gamestates/ovl_opening/z_opening.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index f25163c5e..47a6821da 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -2006,7 +2006,7 @@ s32 func_800C0DB4(GlobalContext* globalCtx, Vec3f* pos) { } void Gameplay_PerformSave(GlobalContext* globalCtx) { - if (globalCtx != NULL) { + if (globalCtx != NULL && gSaveContext.fileNum != 0xFF) { Gameplay_SaveSceneFlags(globalCtx); gSaveContext.savedSceneNum = globalCtx->sceneNum; if (gSaveContext.temporaryWeapon) { diff --git a/soh/src/overlays/gamestates/ovl_opening/z_opening.c b/soh/src/overlays/gamestates/ovl_opening/z_opening.c index fa8ce9060..3b5beebd7 100644 --- a/soh/src/overlays/gamestates/ovl_opening/z_opening.c +++ b/soh/src/overlays/gamestates/ovl_opening/z_opening.c @@ -10,6 +10,7 @@ void Opening_SetupTitleScreen(OpeningContext* this) { gSaveContext.gameMode = 1; this->state.running = false; gSaveContext.linkAge = 0; + gSaveContext.fileNum = 0xFF; Sram_InitDebugSave(); gSaveContext.cutsceneIndex = 0xFFF3; gSaveContext.sceneSetupIndex = 7;