From 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Sun, 18 Sep 2022 13:25:09 -0500 Subject: [PATCH] Fix BGS softlock for shopsanity --- soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 31568fe02..91e4f015f 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -1740,6 +1740,16 @@ void EnOssan_State_ContinueShoppingPrompt(EnOssan* this, GlobalContext* globalCt EnGirlA* selectedItem; u8 talkState = Message_GetState(&globalCtx->msgCtx); + // BGS displays two text boxes when given, which breaks this actor as it expected the second + // text box to be a yes/no prompt, so ensure the yes/no prompt is displaying now. + ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(globalCtx->sceneNum, this->cursorIndex); + if (shopItemIdentity.randomizerCheck != RC_UNKNOWN_CHECK) { + GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheckWithoutObtainabilityCheck(shopItemIdentity.randomizerCheck, shopItemIdentity.ogItemId); + if (getItemEntry.getItemId == GI_SWORD_BGS && (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) { + Message_ContinueTextbox(globalCtx, 0x6B); + } + } + if (talkState == TEXT_STATE_CHOICE) { if (Message_ShouldAdvance(globalCtx)) { EnOssan_ResetItemPosition(this);