1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Fix #23781: Changing weather does not update state for next weather (#23782)

* Fix #23781: Changing weather does not update state for next weather

* Bump up network version
This commit is contained in:
Matt
2025-02-05 16:36:26 +02:00
committed by GitHub
parent 784cd027fe
commit eefba52735
2 changed files with 4 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ using namespace OpenRCT2;
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
constexpr uint8_t kNetworkStreamVersion = 0;
constexpr uint8_t kNetworkStreamVersion = 1;
const std::string kNetworkStreamID = std::string(kOpenRCT2Version) + "-" + std::to_string(kNetworkStreamVersion);

View File

@@ -223,7 +223,7 @@ void ClimateForceWeather(WeatherType weather)
gameState.ClimateCurrent.Temperature = pattern.baseTemperature + trait.temperatureDelta;
gameState.ClimateUpdateTimer = 1920;
ClimateUpdate();
ClimateDetermineFutureWeather(ScenarioRand());
// In case of change in gloom level force a complete redraw
GfxInvalidateScreen();
@@ -311,8 +311,8 @@ static void ClimateDetermineFutureWeather(uint32_t randomValue)
// Generate a random index with values 0 up to randomBias-1
// and choose weather from the distribution table accordingly
const auto& pattern = kClimatePatterns[EnumValue(gameState.Climate)][month];
size_t randomIndex = ((randomValue % 256) * pattern.randomBias) / 256;
auto nextWeather = pattern.distribution[randomIndex];
const auto randomIndex = ((randomValue % 256) * pattern.randomBias) / 256;
const auto nextWeather = pattern.distribution[randomIndex];
gameState.ClimateNext.Weather = nextWeather;
const auto& nextWeatherTrait = kClimateWeatherTraits[EnumValue(nextWeather)];