diff --git a/soh/soh/Enhancements/BunnyHood.cpp b/soh/soh/Enhancements/BunnyHood.cpp index 66268a6c51..9c459dc23f 100644 --- a/soh/soh/Enhancements/BunnyHood.cpp +++ b/soh/soh/Enhancements/BunnyHood.cpp @@ -61,6 +61,13 @@ static void RegisterBunnyHood() { *movementSpeed *= Ship_GetBunnyHoodRunFactor(player); }); + // Faster running can reach a grotto before scene fade-in ends, breaking entrance. Wait for fade to finish. + COND_VB_SHOULD(VB_DOOR_ANA_GRAB_PLAYER, bunnyHoodActive, { + if (gPlayState->transitionTrigger != TRANS_TRIGGER_OFF) { + *should = false; + } + }); + // Gameplay stat: time spent wearing the hood COND_HOOK(OnPlayerUpdate, bunnyHoodActive, []() { if (gSaveContext.ship.stats.gameComplete || (IS_BOSS_RUSH && gSaveContext.ship.quest.data.bossRush.isPaused)) { diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 81e6edddc5..cfaef048a9 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -626,6 +626,16 @@ typedef enum { // - `int32_t` (actorCategory) VB_DETECT_BGM_ENEMY, + // #### `result` + // ```c + // !Player_InCsMode(play) && !(player->stateFlags1 & (PLAYER_STATE1_ON_HORSE | PLAYER_STATE1_IN_WATER)) && + // this->actor.xzDistToPlayer <= 15.0f && -50.0f <= this->actor.yDistToPlayer && + // this->actor.yDistToPlayer <= 15.0f + // ``` + // #### `args` + // - None + VB_DOOR_ANA_GRAB_PLAYER, + // #### `result` // ```c // !Flags_GetSwitch(play, this->actor.params & 0x3F) diff --git a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 7e02eb7347..ad9f1916f7 100644 --- a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -9,6 +9,7 @@ #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/randomizer/randomizer_grotto.h" #include "soh/OTRGlobals.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_DURING_OCARINA @@ -152,9 +153,11 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) { DoorAna_SetupAction(this, DoorAna_GrabPlayer); } else { - if (!Player_InCsMode(play) && !(player->stateFlags1 & (PLAYER_STATE1_ON_HORSE | PLAYER_STATE1_IN_WATER)) && - this->actor.xzDistToPlayer <= 15.0f && -50.0f <= this->actor.yDistToPlayer && - this->actor.yDistToPlayer <= 15.0f) { + if (GameInteractor_Should(VB_DOOR_ANA_GRAB_PLAYER, + !Player_InCsMode(play) && + !(player->stateFlags1 & (PLAYER_STATE1_ON_HORSE | PLAYER_STATE1_IN_WATER)) && + this->actor.xzDistToPlayer <= 15.0f && -50.0f <= this->actor.yDistToPlayer && + this->actor.yDistToPlayer <= 15.0f)) { player->stateFlags1 |= PLAYER_STATE1_FLOOR_DISABLED; this->actor.targetMode = 1; } else {