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

Close #12446: Refactor WEATHER to use strong enum (#13434)

This commit is contained in:
Ghlen Nagels
2020-11-22 18:34:30 +01:00
committed by GitHub
parent 3d1c1b7e65
commit 8c55d1ea9f
15 changed files with 105 additions and 89 deletions

View File

@@ -550,15 +550,9 @@ int32_t cmdline_for_gfxbench(const char** argv, int32_t argc)
static void ApplyOptions(const ScreenshotOptions* options, rct_viewport& viewport)
{
if (options->weather != 0)
if (options->weather != WeatherType::Sunny && options->weather != WeatherType::Count)
{
if (options->weather < 1 || options->weather > 6)
{
throw std::runtime_error("Weather can only be set to an integer value from 1 till 6.");
}
uint8_t customWeather = options->weather - 1;
climate_force_weather(customWeather);
climate_force_weather(WeatherType{ static_cast<uint8_t>(EnumValue(options->weather) - 1) });
}
if (options->hide_guests)