Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed switch syntax in Task_TryFieldPoisonWhiteOut #1750

Merged
merged 1 commit into from
Aug 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions src/field_poison.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,40 +67,40 @@ static void Task_TryFieldPoisonWhiteOut(u8 taskId)
s16 *data = gTasks[taskId].data;
switch (tState)
{
case 0:
for (; tPartyIdx < PARTY_SIZE; 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())
case 0:
for (; tPartyIdx < PARTY_SIZE; tPartyIdx++)
{
if (MonFaintedFromPoison(tPartyIdx))
{
// 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;
}
}

Expand Down