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 authored and GitHub committed 2025-02-05 15:36:26 +01:00
1 parent 784cd027fe
commit eefba52735
2 files changed
+4 -4

No files matched your search

+1 -1
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);
+3 -3
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)];