From 06a665be0e619a9107251bc97a8e0fa857cb88a2 Mon Sep 17 00:00:00 2001 From: cawtds Date: Sun, 2 Jun 2024 13:25:30 +0200 Subject: [PATCH] species inheritance: consider cases with different evolutions but same base species e.g. Persian and Perrserker ball inheritance: fix inheritance for regional forms --- src/daycare.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/daycare.c b/src/daycare.c index e55456e655bc..c5a46c58b0f2 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -697,7 +697,7 @@ static void InheritPokeball(struct Pokemon *egg, struct BoxPokemon *father, stru if (P_BALL_INHERITING >= GEN_7) { - if (fatherSpecies == motherSpecies) + if (GET_BASE_SPECIES_ID(fatherSpecies) == GET_BASE_SPECIES_ID(motherSpecies)) inheritBall = (Random() % 2 == 0 ? motherBall : fatherBall); else if (motherSpecies != SPECIES_DITTO) inheritBall = motherBall; @@ -1025,7 +1025,7 @@ static u16 DetermineEggSpeciesAndParentSlots(struct DayCare *daycare, u8 *parent u16 i; u16 species[DAYCARE_MON_COUNT]; u16 eggSpecies, parentSpecies; - bool32 hasMotherEverstone, hasFatherEverstone; + bool8 hasMotherEverstone, hasFatherEverstone; for (i = 0; i < DAYCARE_MON_COUNT; i++) { @@ -1047,10 +1047,10 @@ static u16 DetermineEggSpeciesAndParentSlots(struct DayCare *daycare, u8 *parent if (hasMotherEverstone) parentSpecies = species[parentSlots[0]]; - else if (hasFatherEverstone && GET_BASE_SPECIES_ID(species[parentSlots[0]]) == GET_BASE_SPECIES_ID(species[parentSlots[1]])) + else if (hasFatherEverstone && GET_BASE_SPECIES_ID(GetEggSpecies(species[parentSlots[0]])) == GET_BASE_SPECIES_ID(GetEggSpecies(species[parentSlots[1]]))) parentSpecies = species[parentSlots[1]]; else - parentSpecies = GET_BASE_SPECIES_ID(species[parentSlots[0]]); + parentSpecies = GET_BASE_SPECIES_ID(GetEggSpecies(species[parentSlots[0]])); eggSpecies = GetEggSpecies(parentSpecies);