From ceb0c67bcfc44ca202e22e9afa5638746a625bd8 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 9 Sep 2022 16:05:32 -0300 Subject: [PATCH] Modified check in case FORM_ITEM_USE of GetFormChangeTargetSpeciesBoxMon --- src/pokemon.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index f735918083d8..b421e5aced14 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8273,26 +8273,23 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 targetSpecies = formChanges[i].targetSpecies; break; case FORM_ITEM_USE: - RtcCalcLocalTime(); if (arg == formChanges[i].param1) { - if (!formChanges[i].param2) + switch (formChanges[i].param2) { + case DAY: + RtcCalcLocalTime(); + if (gLocalTime.hours >= 12 && gLocalTime.hours < 24) + targetSpecies = formChanges[i].targetSpecies; + break; + case NIGHT: + RtcCalcLocalTime(); + if (gLocalTime.hours >= 0 && gLocalTime.hours < 12) + targetSpecies = formChanges[i].targetSpecies; + break; + default: targetSpecies = formChanges[i].targetSpecies; - } - else - { - switch (formChanges[i].param2) - { - case DAY: - if (gLocalTime.hours >= 12 && gLocalTime.hours < 24) - targetSpecies = formChanges[i].targetSpecies; - break; - case NIGHT: - if (gLocalTime.hours >= 0 && gLocalTime.hours < 12) - targetSpecies = formChanges[i].targetSpecies; - break; - } + break; } } break;