@@ -107,7 +107,7 @@ public WeatherControl(Viewer viewer)
107107 UpdateSoundSources ( ) ;
108108 UpdateVolume ( ) ;
109109 // We have a pause in weather change, depending from randomization level
110- dynamicWeather . stableWeatherTimer = ( 4.0f - Viewer . Settings . ActWeatherRandomizationLevel ) * 600 + Simulator . Random . Next ( 300 ) - 150 ;
110+ dynamicWeather . stableWeatherTimer = ( 4.0f - Viewer . Settings . ActWeatherRandomizationLevel ) * 600 + Viewer . Random . Next ( 300 ) - 150 ;
111111 weatherChangeOn = true ;
112112 }
113113
@@ -262,14 +262,14 @@ private bool RandomizeInitialWeather()
262262 CheckDesertZone ( ) ;
263263 if ( DesertZone ) return false ;
264264 // First define overcast
265- var randValue = Simulator . Random . Next ( 170 ) ;
265+ var randValue = Viewer . Random . Next ( 170 ) ;
266266 var intermValue = randValue >= 50 ? ( float ) ( randValue - 50f ) : ( float ) randValue ;
267267 Weather . OvercastFactor = intermValue >= 20 ? ( float ) ( intermValue - 20f ) / 100f : ( float ) intermValue / 100f ; // give more probability to less overcast
268268 Viewer . Simulator . WeatherType = Orts . Formats . Msts . WeatherType . Clear ;
269269 // Then check if we are in precipitation zone
270270 if ( Weather . OvercastFactor > 0.5 )
271271 {
272- randValue = Simulator . Random . Next ( 75 ) ;
272+ randValue = Viewer . Random . Next ( 75 ) ;
273273 if ( randValue > 40 )
274274 {
275275 Weather . PricipitationIntensityPPSPM2 = ( float ) ( randValue - 40f ) / 1000f ;
@@ -288,7 +288,7 @@ private bool RandomizeInitialWeather()
288288 }
289289 else Weather . PricipitationIntensityPPSPM2 = 0 ;
290290 // and now define visibility
291- randValue = Simulator . Random . Next ( 2000 ) ;
291+ randValue = Viewer . Random . Next ( 2000 ) ;
292292 if ( Weather . PricipitationIntensityPPSPM2 > 0 || Weather . OvercastFactor > 0.7f )
293293 // use first digit to define power of ten and the other three to define the multiplying number
294294 Weather . FogDistance = Math . Max ( 100 , ( float ) Math . Pow ( 10 , ( ( int ) ( randValue / 1000 ) + 2 ) ) * ( float ) ( ( randValue % 1000 + 1 ) / 100f ) ) ;
@@ -772,9 +772,9 @@ public void WeatherChange_NextRandomization(ElapsedTime elapsedTime, WeatherCont
772772 {
773773 // define how much time transition will last
774774 var weatherChangeTimer = ( 4 - weatherControl . Viewer . Settings . ActWeatherRandomizationLevel ) * 600 +
775- Simulator . Random . Next ( ( 4 - weatherControl . Viewer . Settings . ActWeatherRandomizationLevel ) * 600 ) ;
775+ Viewer . Random . Next ( ( 4 - weatherControl . Viewer . Settings . ActWeatherRandomizationLevel ) * 600 ) ;
776776 // begin with overcast
777- var randValue = Simulator . Random . Next ( 170 ) ;
777+ var randValue = Viewer . Random . Next ( 170 ) ;
778778 var intermValue = randValue >= 50 ? ( float ) ( randValue - 50f ) : ( float ) randValue ;
779779 ORTSOvercast = intermValue >= 20 ? ( float ) ( intermValue - 20f ) / 100f : ( float ) intermValue / 100f ; // give more probability to less overcast
780780 ORTSOvercastTransitionTimeS = weatherChangeTimer ;
@@ -783,7 +783,7 @@ public void WeatherChange_NextRandomization(ElapsedTime elapsedTime, WeatherCont
783783 // Then check if we are in precipitation zone
784784 if ( ORTSOvercast > 0.5 )
785785 {
786- randValue = Simulator . Random . Next ( 75 ) ;
786+ randValue = Viewer . Random . Next ( 75 ) ;
787787 if ( randValue > 40 )
788788 {
789789 ORTSPrecipitationIntensity = ( float ) ( randValue - 40f ) / 1000f ;
@@ -821,7 +821,7 @@ public void WeatherChange_NextRandomization(ElapsedTime elapsedTime, WeatherCont
821821 }
822822
823823 // and now define visibility
824- randValue = Simulator . Random . Next ( 2000 ) ;
824+ randValue = Viewer . Random . Next ( 2000 ) ;
825825 if ( ORTSPrecipitationIntensity > 0 || ORTSOvercast > 0.7f )
826826 // use first digit to define power of ten and the other three to define the multiplying number
827827 ORTSFog = Math . Max ( 100 , ( float ) Math . Pow ( 10 , ( ( int ) ( randValue / 1000 ) + 2 ) ) * ( float ) ( ( randValue % 1000 + 1 ) / 100f ) ) ;
0 commit comments