1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-25 15:54:31 +01:00

Replace uint8's with EnumValue

Replace uint8's with EnumValue

Replace uint8's with EnumValue

Revertl arge change

Revert large change

Format
This commit is contained in:
Harry-Hopkinson
2024-03-04 18:15:23 +00:00
committed by Harry Hopkinson
parent ef9840f29b
commit 56df39dcb4
18 changed files with 39 additions and 37 deletions

View File

@@ -91,7 +91,7 @@ void ClimateReset(ClimateType climate)
auto& gameState = GetGameState();
auto weather = WeatherType::PartiallyCloudy;
int32_t month = GetDate().GetMonth();
const WeatherTransition* transition = &ClimateTransitions[static_cast<uint8_t>(climate)][month];
const WeatherTransition* transition = &ClimateTransitions[EnumValue(climate)][month];
const WeatherState* weatherState = &ClimateWeatherData[EnumValue(weather)];
gameState.Climate = climate;
@@ -202,7 +202,7 @@ void ClimateForceWeather(WeatherType weather)
{
auto& gameState = GetGameState();
int32_t month = GetDate().GetMonth();
const WeatherTransition* transition = &ClimateTransitions[static_cast<uint8_t>(gameState.Climate)][month];
const WeatherTransition* transition = &ClimateTransitions[EnumValue(gameState.Climate)][month];
const auto weatherState = &ClimateWeatherData[EnumValue(weather)];
gameState.ClimateCurrent.Weather = weather;
@@ -306,7 +306,7 @@ static void ClimateDetermineFutureWeather(int32_t randomDistribution)
// Generate a random variable with values 0 up to DistributionSize-1 and chose weather from the distribution table
// accordingly
const WeatherTransition* transition = &ClimateTransitions[static_cast<uint8_t>(gameState.Climate)][month];
const WeatherTransition* transition = &ClimateTransitions[EnumValue(gameState.Climate)][month];
WeatherType nextWeather = (transition->Distribution[((randomDistribution & 0xFF) * transition->DistributionSize) >> 8]);
gameState.ClimateNext.Weather = nextWeather;