Skip to content

Commit

Permalink
Modified check in case FORM_ITEM_USE of GetFormChangeTargetSpeciesBoxMon
Browse files Browse the repository at this point in the history
  • Loading branch information
LOuroboros committed Sep 9, 2022
1 parent 12fee71 commit ceb0c67
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions src/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ceb0c67

Please sign in to comment.