Fixes Quash-affected battlers having the wrong order for End Turn effects (#5838)
This commit is contained in:
parent
a797e901b2
commit
4ac9dea30e
2 changed files with 2 additions and 6 deletions
|
@ -6757,6 +6757,7 @@ static void AnimTask_AllySwitchDataSwap(u8 taskId)
|
|||
break;
|
||||
}
|
||||
SWAP(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], temp);
|
||||
SWAP(gActionsByTurnOrder[i], gActionsByTurnOrder[j], temp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue