Use GetBattlerAbility instead of the ability field in more places (#4746)

* Fix Skill Link ignoring gastro acid, neutralising gas

* Fix own tempo stopping berserk gene confusion when disabled
This commit is contained in:
sneed 2024-06-08 23:58:37 +03:00 committed by GitHub
parent 568ce39c5d
commit db15190508
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3580,7 +3580,7 @@ u8 AtkCanceller_UnableToUseMove(u32 moveType)
case CANCELLER_MULTIHIT_MOVES:
if (gMovesInfo[gCurrentMove].effect == EFFECT_MULTI_HIT)
{
u16 ability = gBattleMons[gBattlerAttacker].ability;
u32 ability = GetBattlerAbility(gBattlerAttacker);
if (ability == ABILITY_SKILL_LINK)
{
@ -11170,7 +11170,7 @@ void RemoveConfusionStatus(u32 battler)
static bool32 CanBeInfinitelyConfused(u32 battler)
{
if (gBattleMons[battler].ability == ABILITY_OWN_TEMPO
if (GetBattlerAbility(battler) == ABILITY_OWN_TEMPO
|| IsBattlerTerrainAffected(battler, STATUS_FIELD_MISTY_TERRAIN)
|| gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SAFEGUARD)
{