From 9990bda7a4e4610390ab92ff0eff90f2a0c7a174 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 1 Sep 2021 02:54:44 -0300 Subject: [PATCH] Fixed `if` statement for stat recalculation Thanks to Syreldar. --- src/battle_script_commands.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index eaceb85450..a3edf689ab 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3964,7 +3964,14 @@ static void Cmd_getexp(void) #if B_RECALCULATE_STATS >= GEN_5 // Recalculate the stats of every party member before the end for (i = 0; i < PARTY_SIZE; i++) - CalculateMonStats(&gPlayerParty[i]); + { + if (GetMonData(&gPlayerParty[i], MON_DATA_HP) != 0 + && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_NONE + && !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) + { + CalculateMonStats(&gPlayerParty[i]); + } + } #endif // not sure why gf clears the item and ability here