diff --git a/src/battle_main.c b/src/battle_main.c index 282b85035..728d33d4e 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4880,6 +4880,17 @@ static void HandleEndTurn_FinishBattle(void) UndoMegaEvolution(i); UndoFormChange(i, B_SIDE_PLAYER, FALSE); } + #if B_RECALCULATE_STATS >= GEN_5 + // Recalculate the stats of every party member before the end + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_NONE + && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG) + { + CalculateMonStats(&gPlayerParty[i]); + } + } + #endif gBattleMainFunc = FreeResetData_ReturnToOvOrDoEvolutions; gCB2_AfterEvolution = BattleMainCB2; } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 1a2d90ac2..2d64f7795 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3961,18 +3961,6 @@ static void Cmd_getexp(void) case 6: // increment instruction if (gBattleControllerExecFlags == 0) { - #if B_RECALCULATE_STATS >= GEN_5 - // Recalculate the stats of every party member before the end - for (i = 0; i < PARTY_SIZE; i++) - { - if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_NONE - && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG) - { - CalculateMonStats(&gPlayerParty[i]); - } - } - #endif - // not sure why gf clears the item and ability here gBattleMons[gBattlerFainted].item = 0; gBattleMons[gBattlerFainted].ability = 0;