Force rain off if clouds are below or equal to 2
This commit is contained in:
parent
a9e13c7238
commit
92c64024eb
@ -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"),
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user