From c0040b5ce55f221dcc058ebdd8a73f9b9b97bea6 Mon Sep 17 00:00:00 2001 From: ExpoSeed <> Date: Tue, 9 Mar 2021 12:20:13 -0600 Subject: [PATCH] Form change on daycare withdraw --- src/daycare.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/daycare.c b/src/daycare.c index 2a1efefcc..82c196c72 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -247,6 +247,7 @@ static void ApplyDaycareExperience(struct Pokemon *mon) static u16 TakeSelectedPokemonFromDaycare(struct DaycareMon *daycareMon) { u16 species; + u16 newSpecies; u32 experience; struct Pokemon pokemon; @@ -254,6 +255,13 @@ static u16 TakeSelectedPokemonFromDaycare(struct DaycareMon *daycareMon) species = GetBoxMonData(&daycareMon->mon, MON_DATA_SPECIES); BoxMonToMon(&daycareMon->mon, &pokemon); + newSpecies = GetFormChangeTargetSpecies(&pokemon, FORM_WITHDRAW, 0); + if (newSpecies != SPECIES_NONE) { + SetMonData(&pokemon, MON_DATA_SPECIES, &newSpecies); + CalculateMonStats(&pokemon); + species = newSpecies; + } + if (GetMonData(&pokemon, MON_DATA_LEVEL) != MAX_LEVEL) { experience = GetMonData(&pokemon, MON_DATA_EXP) + daycareMon->steps;