From 4423f79b6605c1593871f588e5f5b9e238f4c5b5 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Thu, 4 May 2023 16:38:56 -0400 Subject: [PATCH] Attempt fixing crash --- src/battle-phases.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/battle-phases.ts b/src/battle-phases.ts index f7def75bde2..8878f6fad70 100644 --- a/src/battle-phases.ts +++ b/src/battle-phases.ts @@ -879,6 +879,13 @@ export abstract class MovePhase extends BattlePhase { console.log(Moves[this.move.moveId]); + if (!this.canMove()) { + if (this.move.isDisabled()) + this.scene.queueMessage(`${this.move.getName()} is disabled!`); + this.end(); + return; + } + const target = this.pokemon.getOpponent(); if (!this.followUp && this.canMove()) @@ -915,13 +922,6 @@ export abstract class MovePhase extends BattlePhase { this.end(); }; - if (!this.canMove()) { - if (this.move.isDisabled()) - this.scene.queueMessage(`${this.move.getName()} is disabled!`); - this.end(); - return; - } - if (!this.followUp && this.pokemon.status && !this.pokemon.status.isPostTurn()) { this.pokemon.status.incrementTurn(); let activated = false;