Updated Ability Patch for Gen 9 functionality (#2989)

This commit is contained in:
Frank DeBlasio 2023-05-14 19:30:30 -04:00 committed by GitHub
parent f6f0e5fa33
commit 2420134e45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4663,7 +4663,6 @@ void Task_AbilityPatch(u8 taskId)
// Can't use.
if (gSpeciesInfo[tSpecies].abilities[tAbilityNum] == 0
|| !tSpecies
|| GetMonData(&gPlayerParty[tMonId], MON_DATA_ABILITY_NUM, NULL) > 1
)
{
gPartyMenuUseExitCallback = FALSE;
@ -4734,7 +4733,10 @@ void ItemUseCB_AbilityPatch(u8 taskId, TaskFunc task)
tState = 0;
tMonId = gPartyMenu.slotId;
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));
gTasks[taskId].func = Task_AbilityPatch;
}