diff options
| author | Adam Bird <Archez@users.noreply.github.com> | 2023-02-26 23:04:57 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-26 23:04:57 -0500 |
| commit | f7bb80794017d1f8a21e93be3f8f4c155f037ebf (patch) | |
| tree | 7ec63561310b1ba34e5b6c544beb2568746acd35 /soh/src/code | |
| parent | 17aeec4b13d03be0fde61e3a78ad932434f8f2ee (diff) | |
[Game Interactor] Add LoadGame and ExitGame hooks (#2542)
* add loadgame/exitgame GI hooks
* implement loadgame/exitgame hooks in game code
* move entrance tracker data lifecycle to hooks
* update cosmetic editor to update onloadgame hook
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_play.c | 3 | ||||
| -rw-r--r-- | soh/src/code/z_sram.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 08f3cb432..bc5b4a42a 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -7,6 +7,7 @@ #include <ImGuiImpl.h> #include "soh/frame_interpolation.h" #include "soh/Enhancements/debugconsole.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include <overlays/actors/ovl_En_Niw/z_en_niw.h> @@ -427,10 +428,12 @@ void Play_Init(GameState* thisx) { } } + // Invalid entrance, so immediately exit the game to opening title if (gSaveContext.entranceIndex == -1) { gSaveContext.entranceIndex = 0; play->state.running = false; SET_NEXT_GAMESTATE(&play->state, Opening_Init, OpeningContext); + GameInteractor_ExecuteOnExitGame(gSaveContext.fileNum); return; } diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index ad78df64e..7e6486734 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -611,6 +611,4 @@ void Sram_InitSram(GameState* gameState) { // When going from a rando save to a vanilla save within the same game instance // we need to reset the entrance table back to its vanilla state Entrance_ResetEntranceTable(); - // Clear out the entrance tracker - Entrance_ClearEntranceTrackingData(); } |
