Skip to content

Commit

Permalink
species inheritance: consider cases with different evolutions but sam…
Browse files Browse the repository at this point in the history
…e base species e.g. Persian and Perrserker

ball inheritance: fix inheritance for regional forms
  • Loading branch information
cawtds committed Jun 2, 2024
1 parent 864ba95 commit 06a665b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/daycare.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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++)
{
Expand All @@ -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);

Expand Down

0 comments on commit 06a665b

Please sign in to comment.