Match battle_script commands

This commit is contained in:
PokeCodec 2020-09-09 11:18:04 -04:00
parent 3af118b0a7
commit a3a8c23e00
1 changed files with 5 additions and 3 deletions

View File

@ -7248,16 +7248,18 @@ static void Cmd_forcerandomswitch(void)
{ {
if (TryDoForceSwitchOut()) if (TryDoForceSwitchOut())
{ {
do{
do do
{ {
i = Random() % monsCount; i = Random() % monsCount;
i += firstMonId; i += firstMonId;
} }
while (i == battler2PartyId while (i == battler2PartyId
|| i == battler1PartyId || i == battler1PartyId);
|| GetMonData(&party[i], MON_DATA_SPECIES) == SPECIES_NONE
}while(GetMonData(&party[i], MON_DATA_SPECIES) == SPECIES_NONE
|| GetMonData(&party[i], MON_DATA_IS_EGG) == TRUE || GetMonData(&party[i], MON_DATA_IS_EGG) == TRUE
|| GetMonData(&party[i], MON_DATA_HP) == 0); || GetMonData(&party[i], MON_DATA_HP) == 0); // Should be one while loop, conjoined by an ||, but that doesn't match. Equivalent logic though
} }
*(gBattleStruct->monToSwitchIntoId + gBattlerTarget) = i; *(gBattleStruct->monToSwitchIntoId + gBattlerTarget) = i;