Adds OnTransitionEnd hook to GameInteractor, called at the end of a transition after all mid-transition setup is called. (#2635)

Transitions final autosave location to `OnTransitionEnd`.

Adds functionality to autosave to set a delayed save flag if AutoSave is set to Major or All Items and one is obtained in a grotto, to avoid grotto autosaving but still provide for the autosave when location-based saving is off.

Fixes small bug with item lookup where sometimes an item's `modIndex` would sometimes be reported one way, but the way Randomizer does things it would be in a the other `modIndex`, and the lookup would fail.

Minor variable name clarification in ItemTableManager.

Modifies AutoSave to account for item ID overlap from `MOD_RANDOMIZER` table (all items in the randomizer table is considered major for AutoSave purposes except ice traps).
This commit is contained in:
Malkierian 2023-04-02 01:47:23 -07:00 committed by GitHub
parent b099b5649b
commit 04d0cd8532
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 237 additions and 70 deletions

View file

@ -869,15 +869,8 @@ void Play_Update(PlayState* play) {
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
}
// 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 < 0xFFF0) && (play->gameplayFrames > 60) && (gSaveContext.pendingSale == ITEM_NONE) &&
(play->sceneNum != SCENE_YOUSEI_IZUMI_TATE) && (play->sceneNum != SCENE_KAKUSIANA) && (play->sceneNum != SCENE_KENJYANOMA)) {
Play_PerformSave(play);
}
GameInteractor_ExecuteOnTransitionEndHooks(play->sceneNum);
}
play->sceneLoadFlag = 0;
} else {