From 271bff5675f69781dcae95c3696347806df9e746 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 2 Nov 2022 10:06:02 -0300 Subject: [PATCH] Gen 5+ stat recalculate in the same party loop at the end of battle that changes forms. --- src/battle_main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/battle_main.c b/src/battle_main.c index 6afae7d9c3..df8e245510 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5203,18 +5203,15 @@ static void HandleEndTurn_FinishBattle(void) UndoMegaEvolution(i); TryFormChange(i, B_SIDE_PLAYER, FORM_CHANGE_BATTLE_END); DoBurmyFormChange(i); - } - #if B_RECALCULATE_STATS >= GEN_5 - // Recalculate the stats of every party member before the end - for (i = 0; i < PARTY_SIZE; i++) - { + #if B_RECALCULATE_STATS >= GEN_5 + // Recalculate the stats of every party member before the end if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_NONE && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG) { CalculateMonStats(&gPlayerParty[i]); } + #endif } - #endif // Clear battle mon species to avoid a bug on the next battle that causes // healthboxes loading incorrectly due to it trying to create a Mega Indicator // if the previous battler would've had.