Hookup weather to seeded randomiser

This commit is contained in:
LoafyLemon 2024-04-27 00:47:19 +01:00
parent db86910a8e
commit eb90a77262
1 changed files with 2 additions and 3 deletions

View File

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