Fixed FORM_ITEM_HOLD_ABILITY check
This commit is contained in:
parent
2b54b48b04
commit
af5ff05338
3 changed files with 9 additions and 4 deletions
|
@ -5314,7 +5314,9 @@ void ItemUseCB_FormChange_ConsumedOnUse(u8 taskId, TaskFunc task)
|
|||
void TryItemHoldFormChange(struct Pokemon *mon)
|
||||
{
|
||||
u16 species = GetMonData(mon, MON_DATA_SPECIES);
|
||||
u16 targetSpecies = GetFormChangeTargetSpecies(mon, FORM_ITEM_HOLD, 0);
|
||||
u16 targetSpecies = GetFormChangeTargetSpecies(mon, FORM_ITEM_HOLD_ABILITY, 0);
|
||||
if (targetSpecies == SPECIES_NONE)
|
||||
targetSpecies = GetFormChangeTargetSpecies(mon, FORM_ITEM_HOLD, 0);
|
||||
if (targetSpecies != SPECIES_NONE)
|
||||
{
|
||||
PlayCry2(targetSpecies, 0, 0x7D, 0xA);
|
||||
|
|
|
@ -8076,7 +8076,7 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg
|
|||
switch (method)
|
||||
{
|
||||
case FORM_ITEM_HOLD:
|
||||
if (heldItem == formChanges[i].param1)
|
||||
if (heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE)
|
||||
targetSpecies = formChanges[i].targetSpecies;
|
||||
break;
|
||||
case FORM_ITEM_USE:
|
||||
|
@ -8088,7 +8088,8 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg
|
|||
targetSpecies = formChanges[i].targetSpecies;
|
||||
break;
|
||||
case FORM_ITEM_HOLD_ABILITY:
|
||||
if (heldItem == formChanges[i].param1 && ability == formChanges[i].param2)
|
||||
if ((heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE)
|
||||
&& ability == formChanges[i].param2)
|
||||
targetSpecies = formChanges[i].targetSpecies;
|
||||
break;
|
||||
case FORM_ITEM_USE_TIME:
|
||||
|
|
|
@ -6883,7 +6883,9 @@ static void ReshowDisplayMon(void)
|
|||
void SetMonFormPSS(struct BoxPokemon *boxMon)
|
||||
{
|
||||
u16 species = GetMonData(boxMon, MON_DATA_SPECIES);
|
||||
u16 targetSpecies = GetFormChangeTargetSpeciesBoxMon(boxMon, FORM_ITEM_HOLD, 0);
|
||||
u16 targetSpecies = GetFormChangeTargetSpeciesBoxMon(boxMon, FORM_ITEM_HOLD_ABILITY, 0);
|
||||
if (targetSpecies == SPECIES_NONE)
|
||||
targetSpecies = GetFormChangeTargetSpeciesBoxMon(boxMon, FORM_ITEM_HOLD, 0);
|
||||
if (targetSpecies != SPECIES_NONE)
|
||||
{
|
||||
//PlayCry2(targetSpecies, 0, 0x7D, 0xA);
|
||||
|
|
Loading…
Reference in a new issue