Attempt fixing crash

This commit is contained in:
Flashfyre 2023-05-04 16:38:56 -04:00
parent 2cafe0bd76
commit 4423f79b66
1 changed files with 7 additions and 7 deletions

View File

@ -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;