mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-18 15:00:55 +00:00
This reverts commit 89d38a3b6bae56d8e4e86a29ddad33908a9b3b56.
This commit is contained in:
parent
10aa85e9db
commit
42d00e208e
@ -4462,10 +4462,9 @@ 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 && (!availablePartyMembers.filter(p => !p.isActive(true)).length || (!this.scene.currentBattle.started && availablePartyMembers.length === 1))) {
|
||||
if (this.isModal && !this.scene.getParty().filter(p => p.isAllowedInBattle() && !p.isActive(true)).length) {
|
||||
return super.end();
|
||||
}
|
||||
|
||||
@ -4475,7 +4474,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 || availablePartyMembers.length > 1 ? this.fieldIndex : 0;
|
||||
const fieldIndex = this.scene.currentBattle.getBattlerCount() === 1 || this.scene.getParty().filter(p => p.isAllowedInBattle()).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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user