Skip to content

Commit

Permalink
Automatic merge of T1.4-458-g992c4f7f0 and 12 pull requests
Browse files Browse the repository at this point in the history
- Pull request #525 at 614b222: TCS extensions
- Pull request #613 at 39fb000: fix: Use properly FPS-independent smoothing function
- Pull request #616 at 1b168a0: Improvements in graduated/full release braking
- Pull request #617 at 99c6474: 02m: Removed menu option Debrief Evaluation. Now always available.
- Pull request #619 at ea10bfc: Adjust HuD to display relevant parameters for DM locomotive
- Pull request #620 at 67c67f1: Adjust kinietic friction calculations
- Pull request #624 at 01231e1: Menu option04 - invert controls
- Pull request #627 at 452a72f: Improve advanced adhesion model
- Pull request #629 at 34abd9c: Refined label for downloading Testing Version
- Pull request #630 at 688d0cd: Sky Color Fix (Addresses Trello Roadmap Card #367 for More accurate sunrise and sunset)
- Pull request #635 at b731488: Minor steam locomotive issues.
- Pull request #639 at 26c4dbf: fix: Use correct randomness source for viewer weather
  • Loading branch information
openrails-bot committed Apr 9, 2022
14 parents c73735d + 992c4f7 + 614b222 + 39fb000 + 1b168a0 + 99c6474 + ea10bfc + 67c67f1 + 01231e1 + 452a72f + 34abd9c + 688d0cd + b731488 + 26c4dbf commit 0db09ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion Source/Orts.Simulation/MultiPlayer/ClientComm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public void Receive(object client)
while (true)
{
bytesRead = 0;
//System.Threading.Thread.Sleep(Program.Random.Next(50, 200));
try
{
//blocks until a client sends a message
Expand Down
1 change: 0 additions & 1 deletion Source/Orts.Simulation/MultiPlayer/OnlinePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public void Receive(object client)

while (true)
{
//System.Threading.Thread.Sleep(Program.Random.Next(50, 200));

bytesRead = 0;

Expand Down
16 changes: 8 additions & 8 deletions Source/RunActivity/Viewer3D/Weather.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public WeatherControl(Viewer viewer)
UpdateSoundSources();
UpdateVolume();
// We have a pause in weather change, depending from randomization level
dynamicWeather.stableWeatherTimer = ( 4.0f - Viewer.Settings.ActWeatherRandomizationLevel) * 600 + Simulator.Random.Next(300) - 150;
dynamicWeather.stableWeatherTimer = ( 4.0f - Viewer.Settings.ActWeatherRandomizationLevel) * 600 + Viewer.Random.Next(300) - 150;
weatherChangeOn = true;
}

Expand Down Expand Up @@ -262,14 +262,14 @@ private bool RandomizeInitialWeather()
CheckDesertZone();
if (DesertZone) return false;
// First define overcast
var randValue = Simulator.Random.Next(170);
var randValue = Viewer.Random.Next(170);
var intermValue = randValue >= 50 ? (float)(randValue - 50f) : (float)randValue;
Weather.OvercastFactor = intermValue >= 20 ? (float)(intermValue - 20f)/100f: (float)intermValue/100f; // give more probability to less overcast
Viewer.Simulator.WeatherType = Orts.Formats.Msts.WeatherType.Clear;
// Then check if we are in precipitation zone
if (Weather.OvercastFactor > 0.5)
{
randValue = Simulator.Random.Next(75);
randValue = Viewer.Random.Next(75);
if (randValue > 40)
{
Weather.PricipitationIntensityPPSPM2 = (float)(randValue - 40f) / 1000f;
Expand All @@ -288,7 +288,7 @@ private bool RandomizeInitialWeather()
}
else Weather.PricipitationIntensityPPSPM2 = 0;
// and now define visibility
randValue = Simulator.Random.Next(2000);
randValue = Viewer.Random.Next(2000);
if (Weather.PricipitationIntensityPPSPM2 > 0 || Weather.OvercastFactor > 0.7f )
// use first digit to define power of ten and the other three to define the multiplying number
Weather.FogDistance = Math.Max ( 100, (float)Math.Pow(10 , ((int)(randValue / 1000) + 2)) * (float)((randValue % 1000 + 1) / 100f));
Expand Down Expand Up @@ -772,9 +772,9 @@ public void WeatherChange_Update(ElapsedTime elapsedTime, WeatherControl weather
{
// define how much time transition will last
var weatherChangeTimer = (4 - weatherControl.Viewer.Settings.ActWeatherRandomizationLevel) * 600 +
Simulator.Random.Next((4 - weatherControl.Viewer.Settings.ActWeatherRandomizationLevel) * 600);
Viewer.Random.Next((4 - weatherControl.Viewer.Settings.ActWeatherRandomizationLevel) * 600);
// begin with overcast
var randValue = Simulator.Random.Next(170);
var randValue = Viewer.Random.Next(170);
var intermValue = randValue >= 50 ? (float)(randValue - 50f) : (float)randValue;
ORTSOvercast = intermValue >= 20 ? (float)(intermValue - 20f) / 100f : (float)intermValue / 100f; // give more probability to less overcast
ORTSOvercastTransitionTimeS = weatherChangeTimer;
Expand All @@ -783,7 +783,7 @@ public void WeatherChange_Update(ElapsedTime elapsedTime, WeatherControl weather
// Then check if we are in precipitation zone
if (ORTSOvercast > 0.5)
{
randValue = Simulator.Random.Next(75);
randValue = Viewer.Random.Next(75);
if (randValue > 40)
{
ORTSPrecipitationIntensity = (float)(randValue - 40f) / 1000f;
Expand Down Expand Up @@ -821,7 +821,7 @@ public void WeatherChange_Update(ElapsedTime elapsedTime, WeatherControl weather
}

// and now define visibility
randValue = Simulator.Random.Next(2000);
randValue = Viewer.Random.Next(2000);
if (ORTSPrecipitationIntensity > 0 || ORTSOvercast > 0.7f)
// use first digit to define power of ten and the other three to define the multiplying number
ORTSFog = Math.Max(100, (float)Math.Pow(10, ((int)(randValue / 1000) + 2)) * (float)((randValue % 1000 + 1) / 100f));
Expand Down

0 comments on commit 0db09ef

Please sign in to comment.