From 0e694ebfb695564f4ec9f4fecf4d90ad5ccccb12 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 24 Mar 2024 22:24:26 -0400 Subject: [PATCH] Fix softlock bug with double trainers --- README.md | 1 - src/phases.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d2b03227e5f..233358079a2 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ - Complete move logic - Abilities - Complete ability logic -- Natures - Pokemon summary screen - Add IV screen - Capture logic diff --git a/src/phases.ts b/src/phases.ts index c590444c15e..6cdc55034dd 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -1691,7 +1691,7 @@ export class EnemyCommandPhase extends FieldPhase { return this.end(); } else if (!trapTag && !trapped.value) { - const partyMemberScores = trainer.getPartyMemberMatchupScores(); + const partyMemberScores = trainer.getPartyMemberMatchupScores(enemyPokemon.trainerSlot); if (partyMemberScores.length) { const matchupScores = opponents.map(opp => enemyPokemon.getMatchupScore(opp)); @@ -1700,7 +1700,7 @@ export class EnemyCommandPhase extends FieldPhase { const sortedPartyMemberScores = trainer.getSortedPartyMemberMatchupScores(partyMemberScores); if (sortedPartyMemberScores[0][1] >= matchupScore * (trainer.config.isBoss ? 2 : 3)) { - const index = trainer.getNextSummonIndex(undefined, partyMemberScores); + const index = trainer.getNextSummonIndex(enemyPokemon.trainerSlot, partyMemberScores); this.scene.currentBattle.turnCommands[this.fieldIndex + BattlerIndex.ENEMY] = { command: Command.POKEMON, cursor: index, args: [ false ] };