From 0c7773ad75b765ffed25050acdc528a601eff48f Mon Sep 17 00:00:00 2001 From: Kurausukun <lord.uber1@gmail.com> Date: Sun, 9 May 2021 01:03:39 -0400 Subject: [PATCH] fix mystery_gift gotos --- src/mystery_gift.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/mystery_gift.c b/src/mystery_gift.c index 1e00a5788..afbe50e4d 100644 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -558,14 +558,12 @@ bool32 MG_PrintTextOnWindow1AndWaitButton(u8 *textState, const u8 *str) { case 0: AddTextPrinterToWindow1(str); - goto inc; + (*textState)++; + break; case 1: DrawDownArrow(1, 0xD0, 0x14, 1, FALSE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); if (({JOY_NEW(A_BUTTON | B_BUTTON);})) - { - inc: (*textState)++; - } break; case 2: DrawDownArrow(1, 0xD0, 0x14, 1, TRUE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); @@ -574,7 +572,7 @@ bool32 MG_PrintTextOnWindow1AndWaitButton(u8 *textState, const u8 *str) return TRUE; case 0xFF: *textState = 2; - break; + return FALSE; } return FALSE; } @@ -809,8 +807,6 @@ static bool32 ValidateCardOrNews(bool32 cardOrNews) static bool32 HandleLoadWonderCardOrNews(u8 * state, bool32 cardOrNews) { - s32 v0; - switch (*state) { case 0: @@ -827,20 +823,18 @@ static bool32 HandleLoadWonderCardOrNews(u8 * state, bool32 cardOrNews) case 1: if (cardOrNews == 0) { - v0 = FadeToWonderCardMenu(); - check: - if (v0 != 0) + if (!FadeToWonderCardMenu()) { - goto done; + return FALSE; } - break; } else { - v0 = FadeToWonderNewsMenu(); - goto check; + if (!FadeToWonderNewsMenu()) + { + return FALSE; + } } - done: *state = 0; return TRUE; }