[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…
Reference in New Issue