From c60ad115cd1768de618070a744a0f85ac9a94975 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Thu, 20 Oct 2022 18:14:20 -0400 Subject: [PATCH] Fixes equipment changes while in water. (#1814) --- soh/src/code/z_parameter.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 02f9395f563..5329ea2df23 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -949,7 +949,15 @@ void func_80083108(GlobalContext* globalCtx) { gSaveContext.buttonStatus[0] = BTN_DISABLED; for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) { - if (func_8008F2F8(globalCtx) == 2) { + if ((gSaveContext.equips.buttonItems[i] >= ITEM_SHIELD_DEKU) && + (gSaveContext.equips.buttonItems[i] <= ITEM_BOOTS_HOVER)) { + // Equipment on c-buttons is always enabled + if (gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] == BTN_DISABLED) { + sp28 = 1; + } + + gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] = BTN_ENABLED; + } else if (func_8008F2F8(globalCtx) == 2) { if ((gSaveContext.equips.buttonItems[i] != ITEM_HOOKSHOT) && (gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT)) { if (gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] == BTN_ENABLED) {