From 64f6c9de09b25989105dbc632bb99506e8202523 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Thu, 7 Mar 2024 08:42:04 -0500 Subject: [PATCH] Re-implement switch out softlock with double rewards bug fixed --- src/phases.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index 75f053c9c..47cd813f2 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -1774,7 +1774,7 @@ export class BattleEndPhase extends BattlePhase { pokemon.resetBattleSummonData(); } - for (let pokemon of this.scene.getParty()) + for (let pokemon of this.scene.getParty().filter(p => !p.isFainted())) applyPostBattleAbAttrs(PostBattleAbAttr, pokemon); this.scene.clearEnemyHeldItemModifiers(); @@ -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.isOnField())) { this.scene.pushPhase(new BattleEndPhase(this.scene)); if (this.scene.currentBattle.battleType === BattleType.TRAINER) this.scene.pushPhase(new TrainerVictoryPhase(this.scene));