From 8e8b006c4901d178bbac85272f4388700650be4f Mon Sep 17 00:00:00 2001 From: Adrian T <68144167+torranx@users.noreply.github.com> Date: Thu, 13 Jun 2024 04:02:28 +0800 Subject: [PATCH] [Bug] add condition before applying IgnoreTypeImmunityAbAttr (#2150) --- src/field/pokemon.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 908a8464d84..8436231dddf 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1146,7 +1146,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { let multiplier = types.map(defType => { if (source) { const ignoreImmunity = new Utils.BooleanHolder(false); - applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, moveType, defType); + if (source.isActive(true) && source.hasAbilityWithAttr(IgnoreTypeImmunityAbAttr)) { + applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, moveType, defType); + } if (ignoreImmunity.value) { return 1; }