From 89da80b9d1f929e9259e554033f2d75e52cbb093 Mon Sep 17 00:00:00 2001 From: Pawkkie <61265402+Pawkkie@users.noreply.github.com> Date: Wed, 9 Apr 2025 09:37:59 -0400 Subject: [PATCH] Ability access cleanup for #6550 (#6565) --- src/battle_ai_util.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index a15d8df6c6..c9fe300652 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -3132,9 +3132,9 @@ static inline bool32 DoesBattlerBenefitFromAllVolatileStatus(u32 battler, u32 ab bool32 ShouldPoison(u32 battlerAtk, u32 battlerDef) { - u32 defAbility = GetBattlerAbility(battlerDef); + u32 defAbility = AI_DATA->abilities[battlerDef]; // Battler can be poisoned and has move/ability that synergizes with being poisoned - if (CanBePoisoned(battlerAtk, battlerDef, GetBattlerAbility(battlerDef)) && ( + if (CanBePoisoned(battlerAtk, battlerDef, defAbility) && ( DoesBattlerBenefitFromAllVolatileStatus(battlerDef, defAbility) || defAbility == ABILITY_POISON_HEAL || (defAbility == ABILITY_TOXIC_BOOST && HasMoveWithCategory(battlerDef, DAMAGE_CATEGORY_PHYSICAL)))) @@ -3152,7 +3152,7 @@ bool32 ShouldPoison(u32 battlerAtk, u32 battlerDef) bool32 ShouldBurn(u32 battlerAtk, u32 battlerDef) { - u32 defAbility = GetBattlerAbility(battlerDef); + u32 defAbility = AI_DATA->abilities[battlerDef]; // Battler can be burned and has move/ability that synergizes with being burned if (CanBeBurned(battlerDef, defAbility) && ( DoesBattlerBenefitFromAllVolatileStatus(battlerDef, defAbility) @@ -3186,7 +3186,7 @@ bool32 ShouldFreezeOrFrostbite(u32 battlerAtk, u32 battlerDef) } else { - u32 defAbility = GetBattlerAbility(battlerDef); + u32 defAbility = AI_DATA->abilities[battlerDef]; // Battler can be frostbitten and has move/ability that synergizes with being frostbitten if (CanBeFrozen(battlerDef) && DoesBattlerBenefitFromAllVolatileStatus(battlerDef, defAbility)) @@ -3206,7 +3206,7 @@ bool32 ShouldFreezeOrFrostbite(u32 battlerAtk, u32 battlerDef) bool32 ShouldParalyze(u32 battlerAtk, u32 battlerDef) { - u32 defAbility = GetBattlerAbility(battlerDef); + u32 defAbility = AI_DATA->abilities[battlerDef]; // Battler can be paralyzed and has move/ability that synergizes with being paralyzed if (CanBeParalyzed(battlerDef, defAbility) && ( DoesBattlerBenefitFromAllVolatileStatus(battlerDef, defAbility)))