Fix failedToTerrain being undefined

This commit is contained in:
Sirz Benjie 2025-02-16 09:44:49 -06:00
parent 6ac2594694
commit df7e6fdce3
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -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;
}