summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjevangelia <263709373+djevangelia@users.noreply.github.com>2026-07-24 18:24:56 +0200
committerGitHub <noreply@github.com>2026-07-24 16:24:56 +0000
commit3c565ed6e626c8b905793a781ba78a9ed59b93cb (patch)
tree47163719cecb4d17e314afde9c1f3cc99e5c4109
parent581af474194877911f5290b581eb91d0d8ea6a8c (diff)
Vanilla bugfix, allow fishing with blank B (#6826)
-rw-r--r--soh/soh/Enhancements/Fishing.cpp28
-rw-r--r--soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h19
-rw-r--r--soh/soh/SohGui/SohMenuEnhancements.cpp4
-rw-r--r--soh/src/overlays/actors/ovl_player_actor/z_player.c7
4 files changed, 55 insertions, 3 deletions
diff --git a/soh/soh/Enhancements/Fishing.cpp b/soh/soh/Enhancements/Fishing.cpp
index 98235c8d4..cddfaa21b 100644
--- a/soh/soh/Enhancements/Fishing.cpp
+++ b/soh/soh/Enhancements/Fishing.cpp
@@ -3,7 +3,8 @@
extern "C" {
#include <variables.h>
-
+extern PlayState* gPlayState;
+extern SaveContext gSaveContext;
f32 Fishing_GetMinimumRequiredScore();
}
@@ -18,4 +19,29 @@ void RegisterFishingMessages() {
COND_ID_HOOK(OnOpenText, 0x4080, CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0), BuildFishingMessage);
}
+// Vanilla bug: Not possible to fish with blank B because blank B item value 0xFF is saved
+// as temp B = disabled B -> fishing pole is unequipped.
+// Fix: If fishing, disregard disabled B and on B press set used item to fishing pole.
+void RegisterAllowFishingBlankB() {
+ COND_VB_SHOULD(VB_PUTAWAY_BECAUSE_DISABLED_ITEM_BUTTONS,
+ (IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("FishingBlankB"), IS_RANDO)), {
+ if (gPlayState->interfaceCtx.unk_260 != 0 &&
+ gSaveContext.equips.buttonItems[0] == ITEM_FISHING_POLE) {
+ *should = false;
+ }
+ });
+
+ COND_VB_SHOULD(
+ VB_OVERRIDE_BUTTON_ITEM_USED, (IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("FishingBlankB"), IS_RANDO)), {
+ s32* i = va_arg(args, s32*);
+ Player* player = va_arg(args, Player*);
+ s32* item = va_arg(args, s32*);
+ if (gPlayState->interfaceCtx.unk_260 != 0 && *i == 0 && player->itemAction == PLAYER_IA_FISHING_POLE) {
+ *item = ITEM_FISHING_POLE;
+ }
+ });
+}
+
static RegisterShipInitFunc initFunc(RegisterFishingMessages, { CVAR_ENHANCEMENT("CustomizeFishing") });
+static RegisterShipInitFunc initAllowFishingBlankB(RegisterAllowFishingBlankB,
+ { CVAR_ENHANCEMENT("FishingBlankB"), "IS_RANDO" });
diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h
index 9d2c1fed1..ceeb4068c 100644
--- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h
+++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h
@@ -3394,6 +3394,25 @@ typedef enum {
VB_PREVENT_HOOKSHOT_PARENT_SOFTLOCK,
// #### `result`
+ // ```c
+ // true
+ // ```
+ // #### `args`
+ // - none
+ VB_PUTAWAY_BECAUSE_DISABLED_ITEM_BUTTONS,
+
+ // #### `result`
+ // ```c
+ // true
+ // ```
+ // #### `args`
+ // - `s32* i` (button index)
+ // - `Player*`
+ // - `s32* item`
+ VB_OVERRIDE_BUTTON_ITEM_USED,
+
+ // #### `result`
+ // ```c
// true if Goron Link is talking
// ```
// #### `args`
diff --git a/soh/soh/SohGui/SohMenuEnhancements.cpp b/soh/soh/SohGui/SohMenuEnhancements.cpp
index c6702276b..b9a134705 100644
--- a/soh/soh/SohGui/SohMenuEnhancements.cpp
+++ b/soh/soh/SohGui/SohMenuEnhancements.cpp
@@ -1676,6 +1676,10 @@ void SohMenu::AddMenuEnhancements() {
.PreFunc(fishingDisabledFunc)
.Options(IntSliderOptions().Min(6).Max(13).DefaultValue(13).Format("%d lbs.").Tooltip(
"The minimum weight for the unique fishing reward as an adult."));
+ AddWidget(path, "Allow fishing with blank B", WIDGET_CVAR_CHECKBOX)
+ .CVar(CVAR_ENHANCEMENT("FishingBlankB"))
+ .Options(CheckboxOptions().Tooltip("Allow fishing even when not having any item equipped on the B button, "
+ "fixing a vanilla bug. Always enabled in randomizer."));
// Extra Modes
path.sidebarName = "Extra Modes";
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 542ce8789..db256f6ba 100644
--- a/soh/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c
@@ -2524,8 +2524,10 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) {
}
if (!Player_ItemIsInUse(this, B_BTN_ITEM) && !Player_ItemIsInUse(this, C_BTN_ITEM(0)) &&
!Player_ItemIsInUse(this, C_BTN_ITEM(1)) && !Player_ItemIsInUse(this, C_BTN_ITEM(2)) && !hasOnDpad) {
- Player_UseItem(play, this, ITEM_NONE);
- return;
+ if (GameInteractor_Should(VB_PUTAWAY_BECAUSE_DISABLED_ITEM_BUTTONS, true)) {
+ Player_UseItem(play, this, ITEM_NONE);
+ return;
+ }
}
}
@@ -2536,6 +2538,7 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) {
}
item = Player_GetItemOnButton(play, i);
+ GameInteractor_Should(VB_OVERRIDE_BUTTON_ITEM_USED, true, &i, this, &item);
if (item >= ITEM_NONE_FE) {
for (i = 0; i < ARRAY_COUNT(sItemButtons); i++) {