summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorJosh Bodner <30329717+jbodner09@users.noreply.github.com>2023-02-27 21:07:47 -0800
committerGitHub <noreply@github.com>2023-02-28 00:07:47 -0500
commitf481b863864df24394011bd66e14ecad9c2eb9d9 (patch)
tree50959e6ce73c4a2782b9436cbec42477cc848569 /soh/src/code
parent061e2326857920344f952595a48e3d3547efe1a9 (diff)
Change autosave to use dropdown (#2550)
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_play.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c
index bc5b4a42a..71e5984e0 100644
--- a/soh/src/code/z_play.c
+++ b/soh/src/code/z_play.c
@@ -870,9 +870,11 @@ void Play_Update(PlayState* play) {
R_UPDATE_RATE = 3;
}
- // Don't autosave in grottos or cutscenes
- // Also don't save when you first load a file
- if (CVarGetInteger("gAutosave", 0) && (gSaveContext.cutsceneIndex == 0) && (play->gameplayFrames > 60) &&
+ // Autosave on area transition unless you're in a cutscene or a grotto since resuming from grottos breaks the game
+ // Also don't save when you first load a file to prevent consumables like magic from being lost
+ // Also don't save if there's a pending shop sale to prevent getting the item for a discount!
+ if ((CVarGetInteger("gAutosave", 0) >= 1) && (CVarGetInteger("gAutosave", 0) <= 3) &&
+ (gSaveContext.cutsceneIndex == 0) && (play->gameplayFrames > 60) && (gSaveContext.pendingSale == ITEM_NONE) &&
(play->sceneNum != SCENE_YOUSEI_IZUMI_TATE) && (play->sceneNum != SCENE_KAKUSIANA) && (play->sceneNum != SCENE_KENJYANOMA)) {
Play_PerformSave(play);
}