summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorJosh Bodner <30329717+jbodner09@users.noreply.github.com>2022-11-14 17:02:07 -0800
committerGitHub <noreply@github.com>2022-11-14 20:02:07 -0500
commite7597bae30230dfc0666cb13893b683f010d4afc (patch)
treed7be422dfdd8633cad6047089851a387ef8c7dcb /soh/src/code
parent8571545bf2514fe4392c639e1dd9b618e3c0eb6c (diff)
Prevent autosave when first loading a file (#1792)
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_play.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c
index 9f5b35447..bf68dfe59 100644
--- a/soh/src/code/z_play.c
+++ b/soh/src/code/z_play.c
@@ -159,6 +159,12 @@ void Play_Destroy(GameState* thisx) {
PlayState* play = (PlayState*)thisx;
Player* player = GET_PLAYER(play);
+
+ // Only initialize the frame counter when exiting the title screen
+ if (gSaveContext.fileNum == 0xFF) {
+ play->gameplayFrames = 0;
+ }
+
// In ER, remove link from epona when entering somewhere that doesn't support epona
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) {
Entrance_HandleEponaState();
@@ -844,7 +850,9 @@ void Play_Update(PlayState* play) {
}
// Don't autosave in grottos or cutscenes
- if (CVar_GetS32("gAutosave", 0) && (play->sceneNum != SCENE_YOUSEI_IZUMI_TATE) && (play->sceneNum != SCENE_KAKUSIANA) && (gSaveContext.cutsceneIndex == 0)) {
+ // Also don't save when you first load a file
+ if (CVar_GetS32("gAutosave", 0) && (gSaveContext.cutsceneIndex == 0) && (play->gameplayFrames > 60) &&
+ (play->sceneNum != SCENE_YOUSEI_IZUMI_TATE) && (play->sceneNum != SCENE_KAKUSIANA)) {
Play_PerformSave(play);
}
}