@@ -107,7 +107,7 @@ public WeatherControl(Viewer viewer)
107
107
UpdateSoundSources ( ) ;
108
108
UpdateVolume ( ) ;
109
109
// 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 ;
111
111
weatherChangeOn = true ;
112
112
}
113
113
@@ -262,14 +262,14 @@ private bool RandomizeInitialWeather()
262
262
CheckDesertZone ( ) ;
263
263
if ( DesertZone ) return false ;
264
264
// First define overcast
265
- var randValue = Simulator . Random . Next ( 170 ) ;
265
+ var randValue = Viewer . Random . Next ( 170 ) ;
266
266
var intermValue = randValue >= 50 ? ( float ) ( randValue - 50f ) : ( float ) randValue ;
267
267
Weather . OvercastFactor = intermValue >= 20 ? ( float ) ( intermValue - 20f ) / 100f : ( float ) intermValue / 100f ; // give more probability to less overcast
268
268
Viewer . Simulator . WeatherType = Orts . Formats . Msts . WeatherType . Clear ;
269
269
// Then check if we are in precipitation zone
270
270
if ( Weather . OvercastFactor > 0.5 )
271
271
{
272
- randValue = Simulator . Random . Next ( 75 ) ;
272
+ randValue = Viewer . Random . Next ( 75 ) ;
273
273
if ( randValue > 40 )
274
274
{
275
275
Weather . PricipitationIntensityPPSPM2 = ( float ) ( randValue - 40f ) / 1000f ;
@@ -288,7 +288,7 @@ private bool RandomizeInitialWeather()
288
288
}
289
289
else Weather . PricipitationIntensityPPSPM2 = 0 ;
290
290
// and now define visibility
291
- randValue = Simulator . Random . Next ( 2000 ) ;
291
+ randValue = Viewer . Random . Next ( 2000 ) ;
292
292
if ( Weather . PricipitationIntensityPPSPM2 > 0 || Weather . OvercastFactor > 0.7f )
293
293
// use first digit to define power of ten and the other three to define the multiplying number
294
294
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
772
772
{
773
773
// define how much time transition will last
774
774
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 ) ;
776
776
// begin with overcast
777
- var randValue = Simulator . Random . Next ( 170 ) ;
777
+ var randValue = Viewer . Random . Next ( 170 ) ;
778
778
var intermValue = randValue >= 50 ? ( float ) ( randValue - 50f ) : ( float ) randValue ;
779
779
ORTSOvercast = intermValue >= 20 ? ( float ) ( intermValue - 20f ) / 100f : ( float ) intermValue / 100f ; // give more probability to less overcast
780
780
ORTSOvercastTransitionTimeS = weatherChangeTimer ;
@@ -783,7 +783,7 @@ public void WeatherChange_NextRandomization(ElapsedTime elapsedTime, WeatherCont
783
783
// Then check if we are in precipitation zone
784
784
if ( ORTSOvercast > 0.5 )
785
785
{
786
- randValue = Simulator . Random . Next ( 75 ) ;
786
+ randValue = Viewer . Random . Next ( 75 ) ;
787
787
if ( randValue > 40 )
788
788
{
789
789
ORTSPrecipitationIntensity = ( float ) ( randValue - 40f ) / 1000f ;
@@ -821,7 +821,7 @@ public void WeatherChange_NextRandomization(ElapsedTime elapsedTime, WeatherCont
821
821
}
822
822
823
823
// and now define visibility
824
- randValue = Simulator . Random . Next ( 2000 ) ;
824
+ randValue = Viewer . Random . Next ( 2000 ) ;
825
825
if ( ORTSPrecipitationIntensity > 0 || ORTSOvercast > 0.7f )
826
826
// use first digit to define power of ten and the other three to define the multiplying number
827
827
ORTSFog = Math . Max ( 100 , ( float ) Math . Pow ( 10 , ( ( int ) ( randValue / 1000 ) + 2 ) ) * ( float ) ( ( randValue % 1000 + 1 ) / 100f ) ) ;
0 commit comments