diff --git a/src/phases.ts b/src/phases.ts index d77ff7c29df..dfadcaf2767 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -4449,9 +4449,10 @@ export class SwitchPhase extends BattlePhase { start() { super.start(); + const availablePartyMembers = this.scene.getParty().filter(p => !p.isFainted()); // Skip modal switch if impossible - if (this.isModal && !this.scene.getParty().filter(p => p.isAllowedInBattle() && !p.isActive(true)).length) { + if (this.isModal && (!availablePartyMembers.filter(p => !p.isActive(true)).length || (!this.scene.currentBattle.started && availablePartyMembers.length === 1))) { return super.end(); } @@ -4461,7 +4462,7 @@ export class SwitchPhase extends BattlePhase { } // Override field index to 0 in case of double battle where 2/3 remaining legal party members fainted at once - const fieldIndex = this.scene.currentBattle.getBattlerCount() === 1 || this.scene.getParty().filter(p => p.isAllowedInBattle()).length > 1 ? this.fieldIndex : 0; + const fieldIndex = this.scene.currentBattle.getBattlerCount() === 1 || availablePartyMembers.length > 1 ? this.fieldIndex : 0; this.scene.ui.setMode(Mode.PARTY, this.isModal ? PartyUiMode.FAINT_SWITCH : PartyUiMode.POST_BATTLE_SWITCH, fieldIndex, (slotIndex: integer, option: PartyOption) => { if (slotIndex >= this.scene.currentBattle.getBattlerCount() && slotIndex < 6) {