From eb90a77262f888cd33e33c0b3c97b66a3f666793 Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Sat, 27 Apr 2024 00:47:19 +0100 Subject: [PATCH] Hookup weather to seeded randomiser --- game/scripts/interface/weather.rpy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/game/scripts/interface/weather.rpy b/game/scripts/interface/weather.rpy index ab99a5ca..bf1ef310 100644 --- a/game/scripts/interface/weather.rpy +++ b/game/scripts/interface/weather.rpy @@ -36,8 +36,7 @@ init python: if value is None or value == "random": period = Calendar.get_period() weights = Weather._interpolate_weights(states.env.day, period) - rand = renpy.random.Random(seed=states.env.day) - value = rand.choices(Weather.weather_types, weights=weights)[0] + value = states.env.random.choices(Weather.weather_types, weights=weights)[0] elif value not in Weather.weather_types: raise ValueError(f"Unsupported weather type: {value!r}") @@ -54,7 +53,7 @@ init python: for i in range(span): day = start_day + i weights = Weather._interpolate_weights(day, period) - rand = renpy.random.Random(seed=day) + rand = states.env._random(day) value = rand.choices(Weather.weather_types, weights=weights)[0] forecast[i] = value