[#1712] Reset fileNum when returning to title screen and prevent saving when file = 0xFF (#1721)

This commit is contained in:
Garrett Cox 2022-10-10 03:16:40 -05:00 committed by GitHub
parent fd3872ae30
commit b0510d78f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -2006,7 +2006,7 @@ s32 func_800C0DB4(GlobalContext* globalCtx, Vec3f* pos) {
} }
void Gameplay_PerformSave(GlobalContext* globalCtx) { void Gameplay_PerformSave(GlobalContext* globalCtx) {
if (globalCtx != NULL) { if (globalCtx != NULL && gSaveContext.fileNum != 0xFF) {
Gameplay_SaveSceneFlags(globalCtx); Gameplay_SaveSceneFlags(globalCtx);
gSaveContext.savedSceneNum = globalCtx->sceneNum; gSaveContext.savedSceneNum = globalCtx->sceneNum;
if (gSaveContext.temporaryWeapon) { if (gSaveContext.temporaryWeapon) {

View File

@ -10,6 +10,7 @@ void Opening_SetupTitleScreen(OpeningContext* this) {
gSaveContext.gameMode = 1; gSaveContext.gameMode = 1;
this->state.running = false; this->state.running = false;
gSaveContext.linkAge = 0; gSaveContext.linkAge = 0;
gSaveContext.fileNum = 0xFF;
Sram_InitDebugSave(); Sram_InitDebugSave();
gSaveContext.cutsceneIndex = 0xFFF3; gSaveContext.cutsceneIndex = 0xFFF3;
gSaveContext.sceneSetupIndex = 7; gSaveContext.sceneSetupIndex = 7;