From 37c69896bea0670a926d51c1c6dfc25c67f4bb79 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Sat, 8 Feb 2025 06:44:49 -0800 Subject: [PATCH] Fix if statement in `FaintPhase` --- src/phases/faint-phase.ts | 2 +- src/test/moves/fell_stinger.test.ts | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/phases/faint-phase.ts b/src/phases/faint-phase.ts index 73a1d6487ca..414aa84ce6c 100644 --- a/src/phases/faint-phase.ts +++ b/src/phases/faint-phase.ts @@ -121,7 +121,7 @@ export class FaintPhase extends PokemonPhase { if (pokemon.turnData?.attacksReceived?.length) { const defeatSource = this.source; - if (defeatSource instanceof Pokemon && defeatSource.isOnField()) { + if (defeatSource?.isOnField()) { applyPostVictoryAbAttrs(PostVictoryAbAttr, defeatSource); const pvmove = allMoves[pokemon.turnData.attacksReceived[0].move]; const pvattrs = pvmove.getAttrs(PostVictoryStatStageChangeAttr); diff --git a/src/test/moves/fell_stinger.test.ts b/src/test/moves/fell_stinger.test.ts index be39f51fb91..1b71a2ca642 100644 --- a/src/test/moves/fell_stinger.test.ts +++ b/src/test/moves/fell_stinger.test.ts @@ -35,14 +35,11 @@ describe("Moves - Fell Stinger", () => { Moves.LEECH_SEED ]) .startingLevel(50) - .disableCrits(); - - game.override.enemyAbility(Abilities.STURDY) + .disableCrits() + .enemyAbility(Abilities.STURDY) .enemySpecies(Species.HYPNO) - .enemyMoveset([ Moves.SPLASH ]) + .enemyMoveset(Moves.SPLASH) .enemyLevel(5); - - game.override.weather(WeatherType.NONE); }); it("should not grant stat boost if opponent gets KO'd by recoil", async () => {