From 83460855f9f0f77f5238dbc6f9795cbfc1aa8510 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:05:32 -0800 Subject: [PATCH] Update `if` check --- src/field/pokemon.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 4866bc54bf9..a1e0684779c 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -2882,7 +2882,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { * We explicitly require to ignore the faint phase here, as we want to show the messages * about the critical hit and the super effective/not very effective messages before the faint phase. */ - const damage = this.damageAndUpdate(isBlockedBySubstitute ? 0 : dmg, result as DamageResult, isCritical, isOneHitKo, isOneHitKo, true, source, move); + const damage = this.damageAndUpdate(isBlockedBySubstitute ? 0 : dmg, result as DamageResult, isCritical, isOneHitKo, isOneHitKo, true, source); if (damage > 0) { if (source.isPlayer()) { @@ -3006,7 +3006,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { * Run PostDamageAbAttr from any source of damage that is not from a multi-hit * Multi-hits are handled in move-effect-phase.ts for PostDamageAbAttr */ - if (source.turnData.hitCount <= 1) { + if (source && source.turnData.hitCount <= 1) { applyPostDamageAbAttrs(PostDamageAbAttr, this, damage, this.hasPassive(), false, [], source); } return damage;