From 28caaaf56b0bb0739d8985d8f49cf181e17c2507 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Sun, 14 Apr 2024 15:56:34 -0400 Subject: [PATCH] Use only one loop in pokerus function, use constant --- src/pokemon.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 6ee052fda576..9e37f45a0e53 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, SPECIES_NONE) || GetMonData(mon, MON_DATA_IS_EGG, 0)); if (!(CheckPartyHasHadPokerus(party, gBitTable[rnd]))) {