From 77b3f136ddd5138bcb1606610eb6c2ccc2684291 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Mon, 24 Apr 2023 00:38:28 -0400 Subject: [PATCH] Fix hanging when move has no effect --- src/battle-phases.ts | 2 +- src/battle-scene.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle-phases.ts b/src/battle-phases.ts index 201f991d9..53eed4f2e 100644 --- a/src/battle-phases.ts +++ b/src/battle-phases.ts @@ -907,8 +907,8 @@ abstract class MoveEffectPhase extends PokemonPhase { // Charge attribute with charge effect takes all effect attributes and applies them to charge stage, so ignore them if this is present if (!isProtected && target.hp && !this.move.getMove().getAttrs(ChargeAttr).filter(ca => (ca as ChargeAttr).chargeEffect).length) applyMoveAttrs(MoveHitEffectAttr, user, target, this.move.getMove()); - this.end(); } + this.end(); }); }); } diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 816b88eff..cf31fa304 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -791,7 +791,7 @@ export default class BattleScene extends Phaser.Scene { if (player === undefined) player = true; return new Promise(resolve => { - const modifiers = player ? this.modifiers : this.enemyModifiers; + const modifiers = player ? this.modifiers : this.enemyModifiers as PersistentModifier[]; for (let modifier of modifiers) { if (modifier instanceof PersistentModifier) (modifier as PersistentModifier).virtualStackCount = 0;