summaryrefslogtreecommitdiff
path: root/soh
diff options
context:
space:
mode:
authordjevangelia <263709373+djevangelia@users.noreply.github.com>2026-07-13 17:32:10 +0200
committerGitHub <noreply@github.com>2026-07-13 15:32:10 +0000
commit852fb86cf297a2411db9c6b49456b3bd59abb341 (patch)
treecb025e239b56a4ad6acf51b6d88fba3d774d65d2 /soh
parentd1d6a564e57a80f6f091b036e325516cffb8b009 (diff)
Rando, prevent carrying abducted Ruto into Bigocto room (#6845)
If Ruto enters Bigocto's room after she has already been abducted, the room behaves weird due to actor functions. Randomizer respawns Ruto after abduction, so this can become a problem. The easiest solution is probably to just not let player open doors to Bigocto room while carrying Ruto after abduction. This fix makes shutter doors in randomizer when offering player to open the door - check scene, abduction flag, if door is transition actor index 21 or 3, held actor, and if held actor is Ruto. Looks like this: https://www.youtube.com/watch?v=2Siq2Z41Pqo The shutter door in decomp and thus this fix uses macros that are missing here, I copied all of them to the corresponding place in actor.h as they are very useful for actor params and will be added anyway when/if code is synced with decomp.
Diffstat (limited to 'soh')
-rw-r--r--soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h8
-rw-r--r--soh/soh/Enhancements/randomizer/hook_handlers.cpp11
-rw-r--r--soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c25
3 files changed, 32 insertions, 12 deletions
diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h
index 2afdac7b6..f37b91f2e 100644
--- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h
+++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h
@@ -1498,6 +1498,14 @@ typedef enum {
// #### `result`
// ```c
+ // false if in Jabu, carrying Ruto, abducted flag set, door is id 21 or 3
+ // ```
+ // #### `args`
+ // - `*Actor` (shutter door)
+ VB_JABU_PREVENT_RUTO_REENTER_BIGOCTO,
+
+ // #### `result`
+ // ```c
// varies
// ```
// #### `args`
diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp
index bed8946b2..c93851a7e 100644
--- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp
+++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp
@@ -1271,6 +1271,17 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
}
break;
}
+ case VB_JABU_PREVENT_RUTO_REENTER_BIGOCTO: {
+ // Don't let player carry Ruto through doors 21 and 3 to Bigocto room if Ruto abducted flag set
+ Player* player = va_arg(args, Player*);
+ Actor* doorActor = va_arg(args, Actor*);
+ if (gPlayState->sceneNum == SCENE_JABU_JABU && GET_INFTABLE(INFTABLE_146) &&
+ (GET_TRANSITION_ACTOR_INDEX(doorActor) == 21 || GET_TRANSITION_ACTOR_INDEX(doorActor) == 3) &&
+ player->heldActor != NULL && player->heldActor->id == ACTOR_EN_RU1) {
+ *should = false;
+ }
+ break;
+ }
case VB_BIGGORON_CONSIDER_SWORD_COLLECTED: {
*should = Flags_GetRandomizerInf(RAND_INF_ADULT_TRADES_DMT_TRADE_CLAIM_CHECK);
break;
diff --git a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c
index 284d3596a..c402fe9a7 100644
--- a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c
+++ b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c
@@ -402,22 +402,23 @@ void DoorShutter_Idle(DoorShutter* this, PlayState* play) {
if (doorDirection != 0) {
Player* player = GET_PLAYER(play);
-
- if (this->unlockTimer != 0) {
- if (this->doorType == SHUTTER_BOSS) {
- if (!CHECK_DUNGEON_ITEM(DUNGEON_KEY_BOSS, gSaveContext.mapIndex)) {
- player->naviTextId = -0x204;
+ if (GameInteractor_Should(VB_JABU_PREVENT_RUTO_REENTER_BIGOCTO, true, player, &this->dyna.actor)) {
+ if (this->unlockTimer != 0) {
+ if (this->doorType == SHUTTER_BOSS) {
+ if (!CHECK_DUNGEON_ITEM(DUNGEON_KEY_BOSS, gSaveContext.mapIndex)) {
+ player->naviTextId = -0x204;
+ return;
+ }
+ } else if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) {
+ player->naviTextId = -0x203;
return;
}
- } else if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) {
- player->naviTextId = -0x203;
- return;
+ player->doorTimer = 10;
}
- player->doorTimer = 10;
+ player->doorType = PLAYER_DOORTYPE_SLIDING;
+ player->doorDirection = doorDirection;
+ player->doorActor = &this->dyna.actor;
}
- player->doorType = PLAYER_DOORTYPE_SLIDING;
- player->doorDirection = doorDirection;
- player->doorActor = &this->dyna.actor;
}
}
}