mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-02-16 17:27:41 +00:00
[Bug] Fix trainer double battle crash (#2573)
* fix double battle crash * remove ! * fixes crash on double battle
This commit is contained in:
parent
71299a731c
commit
2bab7d3778
@ -432,9 +432,9 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
const party = this.scene.getEnemyParty();
|
||||
const nonFaintedPartyMembers = party.slice(this.scene.currentBattle.getBattlerCount()).filter(p => !p.isFainted()).filter(p => !trainerSlot || p.trainerSlot === trainerSlot);
|
||||
const partyMemberScores = nonFaintedPartyMembers.map(p => {
|
||||
const playerField = this.scene.getPlayerField();
|
||||
const nonFaintedLegalPartyMembers = party.slice(this.scene.currentBattle.getBattlerCount()).filter(p => p.isAllowedInBattle()).filter(p => !trainerSlot || p.trainerSlot === trainerSlot);
|
||||
const partyMemberScores = nonFaintedLegalPartyMembers.map(p => {
|
||||
const playerField = this.scene.getPlayerField().filter(p => p.isAllowedInBattle());
|
||||
let score = 0;
|
||||
for (const playerPokemon of playerField) {
|
||||
score += p.getMatchupScore(playerPokemon);
|
||||
|
Loading…
x
Reference in New Issue
Block a user