From 946fbb1fa2dc76e9e3a1f791f95ad5293a41a978 Mon Sep 17 00:00:00 2001 From: LittleCube Date: Wed, 25 Sep 2024 21:07:55 -0400 Subject: [PATCH] add init event --- patches/play_patches.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patches/play_patches.c b/patches/play_patches.c index eedda5d..3f57166 100644 --- a/patches/play_patches.c +++ b/patches/play_patches.c @@ -4,6 +4,7 @@ extern Input D_801F6C18; +RECOMP_DECLARE_EVENT(recomp_on_init(PlayState* play)); RECOMP_DECLARE_EVENT(recomp_on_play_main(PlayState* play)); RECOMP_DECLARE_EVENT(recomp_before_play_update(PlayState* play)); RECOMP_DECLARE_EVENT(recomp_after_play_update(PlayState* play)); @@ -12,10 +13,18 @@ void controls_play_update(PlayState* play) { gSaveContext.options.zTargetSetting = recomp_get_targeting_mode(); } +bool inited = false; + // @recomp Patched to add hooks for various added functionality. RECOMP_PATCH void Play_Main(GameState* thisx) { static Input* prevInput = NULL; PlayState* this = (PlayState*)thisx; + + if (!inited) { + recomp_on_init(this); + inited = true; + } + recomp_on_play_main(this); // @recomp