From 767008427f6abb9a22a9a7d6dc9f23596f639523 Mon Sep 17 00:00:00 2001 From: Jaizu Date: Tue, 31 Jan 2023 09:47:02 +0100 Subject: [PATCH] Don't pass down daycare like AlterEggSpeciesWithIncenseItem --- src/daycare.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/daycare.c b/src/daycare.c index 54a5e4c8f..cabecc8ea 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -537,8 +537,10 @@ static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv) } } -static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare, struct BoxPokemon *father, struct BoxPokemon *mother) +static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare) { + u16 motherItem = GetBoxMonData(&daycare->mons[0].mon, MON_DATA_HELD_ITEM); + u16 fatherItem = GetBoxMonData(&daycare->mons[1].mon, MON_DATA_HELD_ITEM); u8 i; u8 selectedIvs[5]; u8 availableIVs[NUM_STATS]; @@ -546,7 +548,7 @@ static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare, struct BoxP u8 iv; u8 howManyIVs = 3; - if (GetBoxMonData(father, MON_DATA_HELD_ITEM) == ITEM_DESTINY_KNOT || GetBoxMonData(mother, MON_DATA_HELD_ITEM) == ITEM_DESTINY_KNOT) + if (motherItem == ITEM_DESTINY_KNOT || fatherItem == ITEM_DESTINY_KNOT) howManyIVs = 5; // Initialize a list of IV indices. @@ -902,7 +904,7 @@ static void _GiveEggFromDaycare(struct DayCare *daycare) AlterEggSpeciesWithIncenseItem(&species, daycare); #endif SetInitialEggData(&egg, species, daycare); - InheritIVs(&egg, daycare, &daycare->mons[parentSlots[1]].mon, &daycare->mons[parentSlots[0]].mon); + InheritIVs(&egg, daycare); InheritPokeball(&egg, &daycare->mons[parentSlots[1]].mon, &daycare->mons[parentSlots[0]].mon); BuildEggMoveset(&egg, &daycare->mons[parentSlots[1]].mon, &daycare->mons[parentSlots[0]].mon);