From 49a2231245fcae0375781183811accad44208dc4 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 4 Nov 2023 22:08:05 -0400 Subject: [PATCH] Fix bug with summoning fainted Pokemon in double battles --- src/battle-scene.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index a3d02be33..343e69067 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -711,8 +711,9 @@ export default class BattleScene extends Phaser.Scene { } if (lastBattle && this.currentBattle.battleType !== BattleType.TRAINER) { + const availablePartyMembers = this.getParty().filter(p => !p.isFainted()).length; this.pushPhase(new CheckSwitchPhase(this, 0, newDouble)); - if (newDouble) + if (newDouble && availablePartyMembers > 1) this.pushPhase(new CheckSwitchPhase(this, 1, newDouble)); } }