summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPepper0ni <93387759+Pepper0ni@users.noreply.github.com>2026-06-18 14:32:04 +0100
committerGitHub <noreply@github.com>2026-06-18 13:32:04 +0000
commit6e6fee8871bb237b1200958cd235f7de79cd9021 (patch)
tree0033c79146effff20606391d2294fa566c89c7fd
parentebdd2c34c7abccba8686a6e06741d60911cb2558 (diff)
Fix Nabooru despawning from spirit when collecting an unrelated check (#6751)
Fix nabooru cutscene skip setting the kidnapped flag too often
-rw-r--r--soh/soh/Enhancements/TimeSavers/timesaver_hook_handlers.cpp6
-rw-r--r--soh/soh/Enhancements/randomizer/hook_handlers.cpp40
-rw-r--r--soh/src/overlays/actors/ovl_player_actor/z_player.c16
3 files changed, 36 insertions, 26 deletions
diff --git a/soh/soh/Enhancements/TimeSavers/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/TimeSavers/timesaver_hook_handlers.cpp
index 7816cdf4d..12b3c83ef 100644
--- a/soh/soh/Enhancements/TimeSavers/timesaver_hook_handlers.cpp
+++ b/soh/soh/Enhancements/TimeSavers/timesaver_hook_handlers.cpp
@@ -499,7 +499,11 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li
break;
case VB_PLAY_NABOORU_CAPTURED_CS:
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) {
- Flags_SetEventChkInf(EVENTCHKINF_NABOORU_CAPTURED_BY_TWINROVA);
+ // we're only here if GetItem is Silver Gauntlets
+ // either it's randomiser, or we're about to enter (or skip) the Nabooru Capture
+ if (!IS_RANDO) {
+ Flags_SetEventChkInf(EVENTCHKINF_NABOORU_CAPTURED_BY_TWINROVA);
+ }
*should = false;
}
break;
diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp
index 1d01488a7..596aab536 100644
--- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp
+++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp
@@ -526,25 +526,29 @@ void RandomizerOnItemReceiveHandler(GetItemEntry receivedItemEntry) {
}
}
- if (loc->GetRandomizerCheck() == RC_SPIRIT_TEMPLE_SILVER_GAUNTLETS_CHEST &&
- !CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) {
- static uint32_t updateHook;
- updateHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnPlayerUpdate>([]() {
- Player* player = GET_PLAYER(gPlayState);
- if (player == NULL || Player_InBlockingCsMode(gPlayState, player) ||
- player->stateFlags1 & PLAYER_STATE1_IN_ITEM_CS || player->stateFlags1 & PLAYER_STATE1_GETTING_ITEM ||
- player->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) {
- return;
- }
+ if (loc->GetRandomizerCheck() == RC_SPIRIT_TEMPLE_SILVER_GAUNTLETS_CHEST) {
+ if (!CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) {
+ static uint32_t updateHook;
+ updateHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnPlayerUpdate>([]() {
+ Player* player = GET_PLAYER(gPlayState);
+ if (player == NULL || Player_InBlockingCsMode(gPlayState, player) ||
+ player->stateFlags1 & PLAYER_STATE1_IN_ITEM_CS ||
+ player->stateFlags1 & PLAYER_STATE1_GETTING_ITEM ||
+ player->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) {
+ return;
+ }
- gPlayState->nextEntranceIndex = ENTR_DESERT_COLOSSUS_EAST_EXIT;
- gPlayState->transitionTrigger = TRANS_TRIGGER_START;
- gSaveContext.nextCutsceneIndex = 0xFFF1;
- gPlayState->transitionType = TRANS_TYPE_SANDSTORM_END;
- GET_PLAYER(gPlayState)->stateFlags1 &= ~PLAYER_STATE1_IN_CUTSCENE;
- Player_TryCsAction(gPlayState, NULL, 8);
- GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnPlayerUpdate>(updateHook);
- });
+ gPlayState->nextEntranceIndex = ENTR_DESERT_COLOSSUS_EAST_EXIT;
+ gPlayState->transitionTrigger = TRANS_TRIGGER_START;
+ gSaveContext.nextCutsceneIndex = 0xFFF1;
+ gPlayState->transitionType = TRANS_TYPE_SANDSTORM_END;
+ GET_PLAYER(gPlayState)->stateFlags1 &= ~PLAYER_STATE1_IN_CUTSCENE;
+ Player_TryCsAction(gPlayState, NULL, 8);
+ GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnPlayerUpdate>(updateHook);
+ });
+ } else {
+ Flags_SetEventChkInf(EVENTCHKINF_NABOORU_CAPTURED_BY_TWINROVA);
+ }
}
}
diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c
index cdeb7a822..ba523a705 100644
--- a/soh/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c
@@ -14187,13 +14187,15 @@ s32 func_8084DFF4(PlayState* play, Player* this) {
play->msgCtx.msgMode = MSGMODE_TEXT_DONE;
} else {
if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) {
- if (GameInteractor_Should(VB_PLAY_NABOORU_CAPTURED_CS, this->getItemId == GI_GAUNTLETS_SILVER)) {
- play->nextEntranceIndex = ENTR_DESERT_COLOSSUS_EAST_EXIT;
- play->transitionTrigger = TRANS_TRIGGER_START;
- gSaveContext.nextCutsceneIndex = 0xFFF1;
- play->transitionType = TRANS_TYPE_SANDSTORM_END;
- this->stateFlags1 &= ~PLAYER_STATE1_IN_CUTSCENE;
- Player_TryCsAction(play, NULL, 8);
+ if (this->getItemId == GI_GAUNTLETS_SILVER) {
+ if (GameInteractor_Should(VB_PLAY_NABOORU_CAPTURED_CS, true)) {
+ play->nextEntranceIndex = ENTR_DESERT_COLOSSUS_EAST_EXIT;
+ play->transitionTrigger = TRANS_TRIGGER_START;
+ gSaveContext.nextCutsceneIndex = 0xFFF1;
+ play->transitionType = TRANS_TYPE_SANDSTORM_END;
+ this->stateFlags1 &= ~PLAYER_STATE1_IN_CUTSCENE;
+ Player_TryCsAction(play, NULL, 8);
+ }
}
// Set unk_862 to 0 early to not have the game draw non-custom colored models for a split second.