From 5dbd90b917c2474cd89b45b2c2e33e1544c43b0e Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 19 Apr 2024 14:17:12 -0400 Subject: [PATCH] Use Only One Loop in RandomlyGivePartyPokerus (#1991) --- src/pokemon.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 6ee052fda5..2b8f4fc95f 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -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]))) {