mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-10-15 08:20:50 -04:00
Fix grotto entrance misbehaving when entering grotto before last transition not done (#7271)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user