Skip to content

Commit

Permalink
Fixes Quash-affected battlers having the wrong order for End Turn eff…
Browse files Browse the repository at this point in the history
…ects (#5838)
  • Loading branch information
PhallenTree authored Dec 20, 2024
1 parent a797e90 commit 4ac9dea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/battle_anim_effects_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -6757,6 +6757,7 @@ static void AnimTask_AllySwitchDataSwap(u8 taskId)
break;
}
SWAP(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], temp);
SWAP(gActionsByTurnOrder[i], gActionsByTurnOrder[j], temp);
break;
}
}
Expand Down
7 changes: 1 addition & 6 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1679,17 +1679,12 @@ u8 DoFieldEndTurnEffects(void)
switch (gBattleStruct->turnCountersTracker)
{
case ENDTURN_ORDER:
for (i = 0; i < gBattlersCount; i++)
{
gBattlerByTurnOrder[i] = i;
}
for (i = 0; i < gBattlersCount - 1; i++)
{
s32 j;
for (j = i + 1; j < gBattlersCount; j++)
{
if (!gProtectStructs[i].quash
&& !gProtectStructs[j].quash
if (!(gProtectStructs[i].quash && gProtectStructs[j].quash)
&& GetWhichBattlerFaster(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], FALSE) == -1)
SwapTurnOrder(i, j);
}
Expand Down

0 comments on commit 4ac9dea

Please sign in to comment.