fix for multi 2vs1 opponent sends out too many mons bug (#6324)
This commit is contained in:
parent
766b9b00ca
commit
2a6fd24954
@ -3816,6 +3816,21 @@ bool32 HasNoMonsToSwitch(u32 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2
|
||||
playerId = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
|
||||
party = gEnemyParty;
|
||||
|
||||
// Edge case: If both opposing Pokemon were knocked out on the same turn,
|
||||
// make sure opponent only sents out the final Pokemon once.
|
||||
if (battler == playerId
|
||||
&& (gHitMarker & HITMARKER_FAINTED(flankId))
|
||||
&& (gHitMarker & HITMARKER_FAINTED(playerId)))
|
||||
{
|
||||
u8 count = 0;
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
if (IsValidForBattle(&party[i]))
|
||||
count++;
|
||||
|
||||
if (count < 2)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (partyIdBattlerOn1 == PARTY_SIZE)
|
||||
partyIdBattlerOn1 = gBattlerPartyIndexes[flankId];
|
||||
if (partyIdBattlerOn2 == PARTY_SIZE)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user