Updated Ability Patch for Gen 9 functionality (#2989)
This commit is contained in:
parent
f6f0e5fa33
commit
2420134e45
1 changed files with 4 additions and 2 deletions
|
@ -4663,7 +4663,6 @@ void Task_AbilityPatch(u8 taskId)
|
||||||
// Can't use.
|
// Can't use.
|
||||||
if (gSpeciesInfo[tSpecies].abilities[tAbilityNum] == 0
|
if (gSpeciesInfo[tSpecies].abilities[tAbilityNum] == 0
|
||||||
|| !tSpecies
|
|| !tSpecies
|
||||||
|| GetMonData(&gPlayerParty[tMonId], MON_DATA_ABILITY_NUM, NULL) > 1
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
gPartyMenuUseExitCallback = FALSE;
|
gPartyMenuUseExitCallback = FALSE;
|
||||||
|
@ -4734,7 +4733,10 @@ void ItemUseCB_AbilityPatch(u8 taskId, TaskFunc task)
|
||||||
tState = 0;
|
tState = 0;
|
||||||
tMonId = gPartyMenu.slotId;
|
tMonId = gPartyMenu.slotId;
|
||||||
tSpecies = GetMonData(&gPlayerParty[tMonId], MON_DATA_SPECIES, NULL);
|
tSpecies = GetMonData(&gPlayerParty[tMonId], MON_DATA_SPECIES, NULL);
|
||||||
tAbilityNum = 2;
|
if (GetMonData(&gPlayerParty[tMonId], MON_DATA_ABILITY_NUM, NULL) == 2)
|
||||||
|
tAbilityNum = 0;
|
||||||
|
else
|
||||||
|
tAbilityNum = 2;
|
||||||
SetWordTaskArg(taskId, tOldFunc, (uintptr_t)(gTasks[taskId].func));
|
SetWordTaskArg(taskId, tOldFunc, (uintptr_t)(gTasks[taskId].func));
|
||||||
gTasks[taskId].func = Task_AbilityPatch;
|
gTasks[taskId].func = Task_AbilityPatch;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue