From 2af572aa304becfdc07b5b170d7bc28cab2e42ae Mon Sep 17 00:00:00 2001 From: briaguya Date: Thu, 11 Aug 2022 01:51:43 -0400 Subject: [PATCH 1/2] add check for mask shop being open to mask select --- soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index fe57289fa..1658a6dc5 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -354,8 +354,13 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { KaleidoScope_SetCursorVtx(pauseCtx, index, pauseCtx->itemVtx); if ((pauseCtx->debugState == 0) && (pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0)) { - if (CVar_GetS32("gMaskSelect", 0) && (gSaveContext.eventChkInf[8] & 0x8000) && - cursorSlot == SLOT_TRADE_CHILD && CHECK_BTN_ALL(input->press.button, BTN_A)) { + // only allow mask select when: + // the shop is open (zelda's letter check): gSaveContext.eventChkInf[4] & 1 + // and the mask quest is complete: gSaveContext.eventChkInf[8] & 0x8000 + if (CVar_GetS32("gMaskSelect", 0) && + (gSaveContext.eventChkInf[8] & 0x8000) && + cursorSlot == SLOT_TRADE_CHILD && CHECK_BTN_ALL(input->press.button, BTN_A) && + (gSaveContext.eventChkInf[4] & 1)) { Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); gSelectingMask = !gSelectingMask; } From 388319deac39c14c4db29459956df5aac1909190 Mon Sep 17 00:00:00 2001 From: briaguya Date: Thu, 11 Aug 2022 02:01:25 -0400 Subject: [PATCH 2/2] add kak gate check for mask select --- soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 1658a6dc5..b8aff2d22 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -355,12 +355,15 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { if ((pauseCtx->debugState == 0) && (pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0)) { // only allow mask select when: - // the shop is open (zelda's letter check): gSaveContext.eventChkInf[4] & 1 + // the shop is open: + // * zelda's letter check: gSaveContext.eventChkInf[4] & 1 + // * kak gate check: gSaveContext.infTable[7] & 0x40 // and the mask quest is complete: gSaveContext.eventChkInf[8] & 0x8000 if (CVar_GetS32("gMaskSelect", 0) && (gSaveContext.eventChkInf[8] & 0x8000) && cursorSlot == SLOT_TRADE_CHILD && CHECK_BTN_ALL(input->press.button, BTN_A) && - (gSaveContext.eventChkInf[4] & 1)) { + (gSaveContext.eventChkInf[4] & 1) && + (gSaveContext.infTable[7] & 0x40)) { Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); gSelectingMask = !gSelectingMask; }