From 90f72a745adde802c9ab287a217b8c80b36b7d21 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 24 Aug 2022 17:01:36 -0300 Subject: [PATCH] Fixed switch syntax in Task_TryFieldPoisonWhiteOut --- src/field_poison.c | 62 +++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/field_poison.c b/src/field_poison.c index e29e1ac988..fcb47acdb8 100644 --- a/src/field_poison.c +++ b/src/field_poison.c @@ -67,40 +67,40 @@ static void Task_TryFieldPoisonWhiteOut(u8 taskId) s16 *data = gTasks[taskId].data; switch (tState) { - case 0: - for (; tPartyIdx < PARTY_SIZE; tPartyIdx++) + case 0: + for (; tPartyIdx < PARTY_SIZE; tPartyIdx++) + { + if (MonFaintedFromPoison(tPartyIdx)) { - if (MonFaintedFromPoison(tPartyIdx)) - { - FaintFromFieldPoison(tPartyIdx); - ShowFieldMessage(gText_PkmnFainted_FldPsn); - tState++; - return; - } - } - tState = 2; // Finished checking party - break; - case 1: - // Wait for "{mon} fainted" message, then return to party loop - if (IsFieldMessageBoxHidden()) - tState--; - break; - case 2: - if (AllMonsFainted()) - { - // Battle facilities have their own white out script to handle the challenge loss - if (InBattlePyramid() | InBattlePike() || InTrainerHillChallenge()) - gSpecialVar_Result = FLDPSN_FRONTIER_WHITEOUT; - else - gSpecialVar_Result = FLDPSN_WHITEOUT; + FaintFromFieldPoison(tPartyIdx); + ShowFieldMessage(gText_PkmnFainted_FldPsn); + tState++; + return; } + } + tState = 2; // Finished checking party + break; + case 1: + // Wait for "{mon} fainted" message, then return to party loop + if (IsFieldMessageBoxHidden()) + tState--; + break; + case 2: + if (AllMonsFainted()) + { + // Battle facilities have their own white out script to handle the challenge loss + if (InBattlePyramid() | InBattlePike() || InTrainerHillChallenge()) + gSpecialVar_Result = FLDPSN_FRONTIER_WHITEOUT; else - { - gSpecialVar_Result = FLDPSN_NO_WHITEOUT; - } - ScriptContext_Enable(); - DestroyTask(taskId); - break; + gSpecialVar_Result = FLDPSN_WHITEOUT; + } + else + { + gSpecialVar_Result = FLDPSN_NO_WHITEOUT; + } + ScriptContext_Enable(); + DestroyTask(taskId); + break; } }