diff --git a/project/src/generators/WeatherGenerator.ts b/project/src/generators/WeatherGenerator.ts index 0f7c8e3a..aacebe4f 100644 --- a/project/src/generators/WeatherGenerator.ts +++ b/project/src/generators/WeatherGenerator.ts @@ -79,10 +79,13 @@ export class WeatherGenerator { * @returns Randomised weather data */ public generateWeather(): IWeather { - const rain = this.getWeightedRain(); + const clouds = this.getWeightedClouds(); + + // Force rain to off if no clouds + const rain = clouds <= 2 ? 1 : this.getWeightedRain(); const result: IWeather = { - cloud: this.getWeightedClouds(), + cloud: clouds, wind_speed: this.getWeightedWindSpeed(), wind_direction: this.getWeightedWindDirection(), wind_gustiness: this.getRandomFloat("windGustiness"), diff --git a/project/src/models/eft/weather/IWeatherData.ts b/project/src/models/eft/weather/IWeatherData.ts index 900c7a97..9e9581e6 100644 --- a/project/src/models/eft/weather/IWeatherData.ts +++ b/project/src/models/eft/weather/IWeatherData.ts @@ -14,10 +14,12 @@ export interface IWeather { temp: number; fog: number; rain_intensity: number; + /** 1 - 3 light rain, 3+ 'rain' */ rain: number; wind_gustiness: number; wind_direction: WindDirection; wind_speed: number; + /** < -0.4 = clear day */ cloud: number; time: string; date: string;