* Set climate and determine start weather. */
| 106 | * Set climate and determine start weather. |
| 107 | */ |
| 108 | void reset() |
| 109 | { |
| 110 | auto& objManager = GetContext()->GetObjectManager(); |
| 111 | auto* climateObj = objManager.GetLoadedObject<ClimateObject>(0); |
| 112 | if (climateObj == nullptr) |
| 113 | return; |
| 114 | |
| 115 | int32_t month = GetDate().GetMonth(); |
| 116 | const Weather::Pattern& pattern = climateObj->getPatternForMonth(month); |
| 117 | |
| 118 | auto weather = Weather::Type::PartiallyCloudy; |
| 119 | const Weather::Trait& trait = kWeatherTraits[EnumValue(weather)]; |
| 120 | |
| 121 | auto& gameState = getGameState(); |
| 122 | gameState.weatherCurrent.weatherType = weather; |
| 123 | gameState.weatherCurrent.temperature = pattern.baseTemperature + trait.temperatureDelta; |
| 124 | gameState.weatherCurrent.weatherEffect = trait.effectLevel; |
| 125 | gameState.weatherCurrent.weatherGloom = trait.gloomLevel; |
| 126 | gameState.weatherCurrent.level = trait.level; |
| 127 | |
| 128 | _lightningTimer = 0; |
| 129 | _thunderTimer = 0; |
| 130 | if (_weatherVolume != 1) |
| 131 | { |
| 132 | stopWeatherSound(); |
| 133 | _weatherVolume = 1; |
| 134 | } |
| 135 | |
| 136 | determineFutureWeather(ScenarioRand()); |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Weather & climate update iteration. |
no test coverage detected