Form change on daycare withdraw

This commit is contained in:
ExpoSeed 2021-03-09 12:20:13 -06:00
parent 3655fe52f3
commit c0040b5ce5

View File

@ -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;