From 2ce74716f7d23d4a3692088aa17605749eb4c67f Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Thu, 7 Mar 2024 00:04:38 -0500 Subject: [PATCH] Fix softlock with wild switch out moves --- src/phases.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phases.ts b/src/phases.ts index 75f053c9c0d..75f82383fae 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2806,7 +2806,7 @@ export class VictoryPhase extends PokemonPhase { } } - if (!this.scene.getEnemyParty().filter(p => !p?.isFainted(true)).length) { + if (!this.scene.getEnemyParty().find(p => this.scene.currentBattle.battleType ? !p?.isFainted(true) : p.isActive(true))) { this.scene.pushPhase(new BattleEndPhase(this.scene)); if (this.scene.currentBattle.battleType === BattleType.TRAINER) this.scene.pushPhase(new TrainerVictoryPhase(this.scene));