Cleaned up getPlayerField

This commit is contained in:
jnotsknab 2025-06-20 19:57:27 -05:00
parent 3681fc5148
commit c4f1ec2a7a

View File

@ -805,10 +805,9 @@ export default class BattleScene extends SceneBase {
*/ */
public getPlayerField(active = false): PlayerPokemon[] { public getPlayerField(active = false): PlayerPokemon[] {
const party = this.getPlayerParty(); const party = this.getPlayerParty();
if (active) { return party
return party.slice(0, Math.min(party.length, this.currentBattle?.double ? 2 : 1)).filter(p => p.isActive()); .slice(0, Math.min(party.length, this.currentBattle?.double ? 2 : 1))
} .filter(p => !active || p.isActive());
return party.slice(0, Math.min(party.length, this.currentBattle?.double ? 2 : 1));
} }
public getEnemyParty(): EnemyPokemon[] { public getEnemyParty(): EnemyPokemon[] {