Skip to content

Commit

Permalink
Use Only One Loop in RandomlyGivePartyPokerus (#1991)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurausukun authored Apr 19, 2024
1 parent 9cfe9b1 commit 5dbd90b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -6038,14 +6038,10 @@ void RandomlyGivePartyPokerus(struct Pokemon *party)

do
{
do
{
rnd = Random() % PARTY_SIZE;
mon = &party[rnd];
}
while (!GetMonData(mon, MON_DATA_SPECIES, 0));
rnd = Random() % PARTY_SIZE;
mon = &party[rnd];
}
while (GetMonData(mon, MON_DATA_IS_EGG, 0));
while (!GetMonData(mon, MON_DATA_SPECIES, 0) || GetMonData(mon, MON_DATA_IS_EGG, 0));

if (!(CheckPartyHasHadPokerus(party, gBitTable[rnd])))
{
Expand Down

0 comments on commit 5dbd90b

Please sign in to comment.