diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index afbc51708..a0df67667 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -623,7 +623,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm { getFormSpriteKey(formIndex?: integer) { if (this.forms.length && formIndex >= this.forms.length) { - console.warn(`Attempted accessing form with index ${formIndex} of species ${this.getName()} with only ${this.forms?.length || 0} forms`); + console.warn(`Attempted accessing form with index ${formIndex} of species ${this.getName()} with only ${this.forms.length || 0} forms`); formIndex = Math.min(formIndex, this.forms.length - 1); } return this.forms?.length diff --git a/src/phases.ts b/src/phases.ts index f1e529888..4fb7517e3 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2850,7 +2850,7 @@ export class FaintPhase extends PokemonPhase { if (allyPokemon?.isActive(true)) { let targetingMovePhase: MovePhase; do { - targetingMovePhase = this.scene.findPhase(mp => mp instanceof MovePhase && mp.targets.length === 1 && mp.targets[0] === pokemon.getBattlerIndex()) as MovePhase; + targetingMovePhase = this.scene.findPhase(mp => mp instanceof MovePhase && mp.targets.length === 1 && mp.targets[0] === pokemon.getBattlerIndex() && mp.pokemon.isPlayer() !== allyPokemon.isPlayer()) as MovePhase; if (targetingMovePhase && targetingMovePhase.targets[0] !== allyPokemon.getBattlerIndex()) targetingMovePhase.targets[0] = allyPokemon.getBattlerIndex(); } while (targetingMovePhase);