diff options
author | PokeCodec <67983839+PokeCodec@users.noreply.github.com> | 2020-09-09 11:18:04 -0400 |
---|---|---|
committer | PokeCodec <67983839+PokeCodec@users.noreply.github.com> | 2020-09-09 11:18:04 -0400 |
commit | a3a8c23e00d410f40dc70a35d9eed24b39102e40 (patch) | |
tree | 13581793f56c4b61c985d0cd27a4b94b365c1945 /src/battle_script_commands.c | |
parent | 3af118b0a7ce1a49d0403bbe30ac2496e1c52c0b (diff) |
Match battle_script commands
Diffstat (limited to 'src/battle_script_commands.c')
-rw-r--r-- | src/battle_script_commands.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 309b375e7..1c11ca6bd 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7248,16 +7248,18 @@ static void Cmd_forcerandomswitch(void) { if (TryDoForceSwitchOut()) { + do{ do { i = Random() % monsCount; i += firstMonId; } while (i == battler2PartyId - || i == battler1PartyId - || GetMonData(&party[i], MON_DATA_SPECIES) == SPECIES_NONE + || i == battler1PartyId); + + }while(GetMonData(&party[i], MON_DATA_SPECIES) == SPECIES_NONE || 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; |