From 2d936cc34b00c1401dfa43a8a07b9f00f3fdc67f Mon Sep 17 00:00:00 2001 From: Matthew Olker Date: Thu, 16 May 2024 18:03:08 -0400 Subject: [PATCH] PR Comments --- src/phases.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index 45c5ea72340..a04f31f4e83 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2051,13 +2051,13 @@ export class TurnStartPhase extends FieldPhase { break; case Command.RUN: let runningPokemon = pokemon; - // check if either active player pokemon has run away if (this.scene.currentBattle.double) { const playerPokemon = field.filter(pokemon => pokemon.isPlayer()); // use the faster stats if not const fasterPokemon = playerPokemon[0].getStat(Stat.SPD) > playerPokemon[1].getStat(Stat.SPD) ? playerPokemon[0] : playerPokemon[1]; + // check if either active player pokemon has run away const hasRunAway = playerPokemon.find(p => p.hasAbility(Abilities.RUN_AWAY)); - runningPokemon = hasRunAway != undefined ? hasRunAway : fasterPokemon; + runningPokemon = hasRunAway !== undefined ? hasRunAway : fasterPokemon; } this.scene.unshiftPhase(new AttemptRunPhase(this.scene, runningPokemon.getFieldIndex())); break;