summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPokeCodec <67983839+PokeCodec@users.noreply.github.com>2020-09-09 14:38:04 -0400
committerPokeCodec <67983839+PokeCodec@users.noreply.github.com>2020-09-09 14:43:41 -0400
commit56afdee7fc1a49343bfb6904e747a07f1399ff7e (patch)
treefa1361fd48d74e2e0962f85ed5f37ff5bd58ee8c
parentaa45c05a3ea052c76c3837dd5e9c89b958bd02f9 (diff)
Remove register variable mention
-rw-r--r--src/battle_script_commands.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c
index 1c11ca6bd..e3405bc0c 100644
--- a/src/battle_script_commands.c
+++ b/src/battle_script_commands.c
@@ -7127,14 +7127,8 @@ static void Cmd_forcerandomswitch(void)
s32 i;
s32 battler1PartyId = 0;
s32 battler2PartyId = 0;
-
- #ifdef NONMATCHING
- s32 lastMonId = 0; // + 1
- #else
- register s32 lastMonId asm("r8") = 0; // + 1
- #endif // NONMATCHING
-
s32 firstMonId;
+ s32 lastMonId = 0; // + 1
s32 monsCount;
struct Pokemon* party = NULL;
s32 validMons = 0;
@@ -7248,16 +7242,14 @@ static void Cmd_forcerandomswitch(void)
{
if (TryDoForceSwitchOut())
{
- do{
do
{
- i = Random() % monsCount;
- i += firstMonId;
- }
- while (i == battler2PartyId
- || i == battler1PartyId);
-
- }while(GetMonData(&party[i], MON_DATA_SPECIES) == SPECIES_NONE
+ do
+ {
+ i = Random() % monsCount;
+ i += firstMonId;
+ } while (i == battler2PartyId || 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); // Should be one while loop, conjoined by an ||, but that doesn't match. Equivalent logic though
}