From 71f5ef549e7da0f4a1cd9a5d2f1f742ad79ee59b Mon Sep 17 00:00:00 2001 From: Unreference <87878910+unreference@users.noreply.github.com> Date: Sat, 16 May 2026 08:37:09 -0700 Subject: [PATCH 1/4] feat(enhancement): Adult Link crawlspaces cheat --- soh/soh/SohGui/SohMenuEnhancements.cpp | 3 +++ soh/src/overlays/actors/ovl_player_actor/z_player.c | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/soh/soh/SohGui/SohMenuEnhancements.cpp b/soh/soh/SohGui/SohMenuEnhancements.cpp index fc4f9f95c80..921cce35654 100644 --- a/soh/soh/SohGui/SohMenuEnhancements.cpp +++ b/soh/soh/SohGui/SohMenuEnhancements.cpp @@ -1763,6 +1763,9 @@ void SohMenu::AddMenuEnhancements() { AddWidget(path, "Climb Everything", WIDGET_CVAR_CHECKBOX) .CVar(CVAR_CHEAT("ClimbEverything")) .Options(CheckboxOptions().Tooltip("Makes every surface in the game climbable.")); + AddWidget(path, "Adult Crawlspaces", WIDGET_CVAR_CHECKBOX) + .CVar(CVAR_CHEAT("AdultCrawlspaces")) + .Options(CheckboxOptions().Tooltip("Allows Adult Link to enter crawlspaces.")); AddWidget(path, "Moon Jump on L", WIDGET_CVAR_CHECKBOX) .CVar(CVAR_CHEAT("MoonJumpOnL")) .Options(CheckboxOptions().Tooltip("Holding L makes you float into the air.")); 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 7ffe8af7f43..96b8077dd41 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -7637,7 +7637,10 @@ s32 Player_TryEnteringCrawlspace(Player* this, PlayState* play, u32 interactWall f32 zVertex2; s32 i; - if (!LINK_IS_ADULT && !(this->stateFlags1 & PLAYER_STATE1_IN_WATER) && (interactWallFlags & 0x30)) { + // #region SOH [Enhancement] - Adult Crawlspaces + if ((!LINK_IS_ADULT || CVarGetInteger(CVAR_CHEAT("AdultCrawlspaces"), 0)) && + // #endregion + !(this->stateFlags1 & PLAYER_STATE1_IN_WATER) && (interactWallFlags & 0x30)) { if (!GameInteractor_Should(VB_CRAWL, true)) { return false; } @@ -16707,4 +16710,4 @@ void Player_StartTalking(PlayState* play, Actor* actor) { this->naviActor->flags |= ACTOR_FLAG_TALK; func_80835EA4(play, 0xB); } -} +} \ No newline at end of file From ca1d39889f543e5486b3d03f89ffb303bc34b877 Mon Sep 17 00:00:00 2001 From: Unreference <87878910+unreference@users.noreply.github.com> Date: Sat, 16 May 2026 16:47:47 -0700 Subject: [PATCH 2/4] Update soh/src/overlays/actors/ovl_player_actor/z_player.c Co-authored-by: Jordan Longstaff --- soh/src/overlays/actors/ovl_player_actor/z_player.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 96b8077dd41..6b88be853ad 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -7637,9 +7637,7 @@ s32 Player_TryEnteringCrawlspace(Player* this, PlayState* play, u32 interactWall f32 zVertex2; s32 i; - // #region SOH [Enhancement] - Adult Crawlspaces - if ((!LINK_IS_ADULT || CVarGetInteger(CVAR_CHEAT("AdultCrawlspaces"), 0)) && - // #endregion + if (GameInteractor_Should(VB_LINK_BE_ABLE_TO_ENTER_CRAWLSPACE, !LINK_IS_ADULT) && !(this->stateFlags1 & PLAYER_STATE1_IN_WATER) && (interactWallFlags & 0x30)) { if (!GameInteractor_Should(VB_CRAWL, true)) { return false; From 5adbce7ac13699a341af90dabd3dc74b3638fcf4 Mon Sep 17 00:00:00 2001 From: Unreference <87878910+unreference@users.noreply.github.com> Date: Sat, 16 May 2026 18:19:59 -0700 Subject: [PATCH 3/4] feat(enhancement): Prefer VB hook over inline CVar --- soh/soh/Enhancements/Cheats/AdultCrawlspaces.cpp | 13 +++++++++++++ .../vanilla-behavior/GIVanillaBehavior.h | 10 +++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 soh/soh/Enhancements/Cheats/AdultCrawlspaces.cpp diff --git a/soh/soh/Enhancements/Cheats/AdultCrawlspaces.cpp b/soh/soh/Enhancements/Cheats/AdultCrawlspaces.cpp new file mode 100644 index 00000000000..d5336a8e55a --- /dev/null +++ b/soh/soh/Enhancements/Cheats/AdultCrawlspaces.cpp @@ -0,0 +1,13 @@ +#include + +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/ShipInit.hpp" + +#define CVAR_ADULT_CRAWLSPACES_NAME CVAR_CHEAT("AdultCrawlspaces") +#define CVAR_ADULT_CRAWLSPACES_VALUE CVarGetInteger(CVAR_ADULT_CRAWLSPACES_NAME, 0) + +void RegisterAdultCrawlspaces() { + COND_VB_SHOULD(VB_LINK_BE_ABLE_TO_ENTER_CRAWLSPACE, CVAR_ADULT_CRAWLSPACES_VALUE, { *should = true; }); +} + +static RegisterShipInitFunc initFunc(RegisterAdultCrawlspaces, { CVAR_ADULT_CRAWLSPACES_NAME }); \ No newline at end of file diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index d1ed4534100..096bef1e6e3 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -2965,7 +2965,15 @@ typedef enum { // ``` // #### `args` // - `*int32_t (camId)` - VB_SHOULD_LOAD_BG_IMAGE + VB_SHOULD_LOAD_BG_IMAGE, + + // #### `result` + // ```c + // !LINK_IS_ADULT + // ``` + // #### `args` + // - None + VB_LINK_BE_ABLE_TO_ENTER_CRAWLSPACE, } GIVanillaBehavior; #endif From 6f0bf5a6f937ea5c300ca27e9d34994d1bcf3a4a Mon Sep 17 00:00:00 2001 From: Unreference <87878910+unreference@users.noreply.github.com> Date: Sun, 17 May 2026 12:23:11 -0700 Subject: [PATCH 4/4] chore: Remove unnecessary include --- soh/soh/Enhancements/Cheats/AdultCrawlspaces.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/soh/soh/Enhancements/Cheats/AdultCrawlspaces.cpp b/soh/soh/Enhancements/Cheats/AdultCrawlspaces.cpp index d5336a8e55a..48364e83cf7 100644 --- a/soh/soh/Enhancements/Cheats/AdultCrawlspaces.cpp +++ b/soh/soh/Enhancements/Cheats/AdultCrawlspaces.cpp @@ -1,5 +1,3 @@ -#include - #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp"