mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 06:49:35 +02:00
fix double battle crash in challenge mode with a single eligible pokemon
This commit is contained in:
parent
5fb160c5d6
commit
e4c9e3f9f7
@ -325,7 +325,7 @@ export default class MysteryEncounter implements IMysteryEncounter {
|
||||
if (activeMon.length > 0) {
|
||||
this.primaryPokemon = activeMon[0];
|
||||
} else {
|
||||
this.primaryPokemon = scene.getParty().filter(p => !p.isFainted())[0];
|
||||
this.primaryPokemon = scene.getParty().filter(p => p.isAllowedInBattle())[0];
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ export class MysteryEncounterBattlePhase extends Phase {
|
||||
}
|
||||
}
|
||||
|
||||
const availablePartyMembers = scene.getParty().filter(p => !p.isFainted());
|
||||
const availablePartyMembers = scene.getParty().filter(p => p.isAllowedInBattle());
|
||||
|
||||
if (!availablePartyMembers[0].isOnField()) {
|
||||
scene.pushPhase(new SummonPhase(scene, 0));
|
||||
|
Loading…
Reference in New Issue
Block a user