[Bug] Prevent attempting to use a move with no pp when pokemon is not on the field (#2532)

* prevent using move with no pp when pokemon is fainted

* change condition to isActive(true)
This commit is contained in:
Adrian T 2024-06-24 06:08:55 +08:00 committed by GitHub
parent d743f7ba7a
commit 20b708170c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -2582,7 +2582,7 @@ export class MovePhase extends BattlePhase {
if (this.move.moveId && this.pokemon.summonData?.disabledMove === this.move.moveId) {
this.scene.queueMessage(`${this.move.getName()} is disabled!`);
}
if (this.move.ppUsed >= this.move.getMovePp()) { // if the move PP was reduced from Spite or otherwise, the move fails
if (this.pokemon.isActive(true) && this.move.ppUsed >= this.move.getMovePp()) { // if the move PP was reduced from Spite or otherwise, the move fails
this.fail();
this.showMoveText();
this.showFailedText();