Use Only One Loop in RandomlyGivePartyPokerus (#1991)

This commit is contained in:
Kurausukun 2024-04-19 14:17:12 -04:00 committed by GitHub
parent 9cfe9b1bdd
commit 5dbd90b917
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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])))
{