From 0f924106203c2b2a0153acce151cdbc93b423a9f Mon Sep 17 00:00:00 2001 From: LittleCube Date: Mon, 14 Oct 2024 16:53:30 -0400 Subject: [PATCH] Add recomp_after_play_init event (#496) * fix signature for recomp_set_allow_no_ocarina_tf, add new event recomp_after_play_init * say initialize instead of construct --- patches/play_patches.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/patches/play_patches.c b/patches/play_patches.c index 1d38632..04f7b88 100644 --- a/patches/play_patches.c +++ b/patches/play_patches.c @@ -151,11 +151,12 @@ void DayTelop_Init_NORELOCATE(GameState*); void TitleSetup_Init_NORELOCATE(GameState*); RECOMP_DECLARE_EVENT(recomp_on_play_init(PlayState* this)); +RECOMP_DECLARE_EVENT(recomp_after_play_init(PlayState* this)); bool allow_no_ocarina_tf = false; -// @recomp_export void recomp_set_allow_no_ocarina(bool new_val): Set whether to force Termina Field to load normally even if Link has no ocarina. -RECOMP_EXPORT void recomp_set_allow_no_ocarina(bool new_val) { +// @recomp_export void recomp_set_allow_no_ocarina_tf(bool new_val): Set whether to force Termina Field to load normally even if Link has no ocarina. +RECOMP_EXPORT void recomp_set_allow_no_ocarina_tf(bool new_val) { allow_no_ocarina_tf = new_val; } @@ -171,7 +172,7 @@ RECOMP_PATCH void Play_Init(GameState* thisx) { u8 sceneLayer; s32 scene; - // @recomp_event recomp_on_play_init(PlayState* this): A new PlayState is being constructed. + // @recomp_event recomp_on_play_init(PlayState* this): A new PlayState is being initialized. recomp_on_play_init(this); if ((gSaveContext.respawnFlag == -4) || (gSaveContext.respawnFlag == -0x63)) { @@ -436,4 +437,7 @@ RECOMP_PATCH void Play_Init(GameState* thisx) { gSaveContext.respawnFlag = 0; sBombersNotebookOpen = false; BombersNotebook_Init(&sBombersNotebook); + + // @recomp_event recomp_after_play_init(PlayState* this): The new PlayState has finished initializing. + recomp_after_play_init(this); }