From 7fc4dbce85eb4bd40270a9edfcc273a079363076 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 5 Apr 2024 23:45:31 -0400 Subject: [PATCH] Fix immutable weather conditions expiring --- src/data/pokemon-species.ts | 2 -- src/data/weather.ts | 4 +++- src/field/arena.ts | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index be779d9a545..32bd8f19610 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -3043,8 +3043,6 @@ export const noStarterFormKeys: string[] = [ SpeciesFormKey.ETERNAMAX ].map(k => k.toString()); -console.log(noStarterFormKeys) - // TODO: Remove { //setTimeout(() => { diff --git a/src/data/weather.ts b/src/data/weather.ts index aeb07a7db33..4d08d117de4 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -26,10 +26,12 @@ export class Weather { constructor(weatherType: WeatherType, turnsLeft?: integer) { this.weatherType = weatherType; - this.turnsLeft = turnsLeft || 0; + this.turnsLeft = !this.isImmutable() ? turnsLeft || 0 : 0; } lapse(): boolean { + if (this.isImmutable()) + return true; if (this.turnsLeft) return !!--this.turnsLeft; diff --git a/src/field/arena.ts b/src/field/arena.ts index 681cb6587e8..1a609cc9c07 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -269,9 +269,8 @@ export class Arena { trySetWeather(weather: WeatherType, hasPokemonSource: boolean): boolean { // override hook for debugging - if (WEATHER_OVERRIDE) { + if (WEATHER_OVERRIDE) return this.trySetWeatherOverride(WEATHER_OVERRIDE); - } if (this.weather?.weatherType === (weather || undefined)) return false;