Change autosave to use dropdown (#2550)

This commit is contained in:
Josh Bodner 2023-02-27 21:07:47 -08:00 committed by GitHub
parent 061e232685
commit f481b86386
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 12 deletions

View file

@ -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);
}