From df7e6fdce35b93efe8f22a786497166ddd17a1fa Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Sun, 16 Feb 2025 09:44:49 -0600 Subject: [PATCH] Fix failedToTerrain being undefined --- src/phases/move-phase.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index dc2b381b923..10c412d4d53 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -329,10 +329,11 @@ export class MovePhase extends BattlePhase { * Move conditions assume the move has a single target * TODO: is this sustainable? */ + let failedDueToTerrain: boolean = false; if (success) { const passesConditions = move.applyConditions(this.pokemon, targets[0], move); const failedDueToWeather: boolean = globalScene.arena.isMoveWeatherCancelled(this.pokemon, move); - const failedDueToTerrain: boolean = globalScene.arena.isMoveTerrainCancelled(this.pokemon, this.targets, move); + failedDueToTerrain = globalScene.arena.isMoveTerrainCancelled(this.pokemon, this.targets, move); success = passesConditions && !failedDueToWeather && !failedDueToTerrain; }