Skip to content

Commit

Permalink
Automatic merge of X1.3.1-196-g253eec25a and 7 pull requests
Browse files Browse the repository at this point in the history
- Pull request #40 at e81861b: Monogame upgrade
- Pull request #79 at 7d9f14b: Update version calculation for new unstable versions
- Pull request #226 at 26983e9: EmbedIO web server graphical track monitor
- Pull request #227 at 6ec1539: EmbedIO web server graphical train driving monitor
- Pull request #228 at 72c0146: adds links to OR on Elvas Tower
- Pull request #232 at aaf2441: JSON consist format: https://blueprints.launchpad.net/or/+spec/consist-editor
- Pull request #234 at 3ac34fe: Rehabilitate unit testing suite, migrate to xUnit 2
  • Loading branch information
openrails-bot committed Jul 25, 2020
9 parents cc5a388 + 253eec2 + e81861b + 7d9f14b + 26983e9 + 6ec1539 + 72c0146 + aaf2441 + 3ac34fe commit 225143d
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions Source/Orts.Simulation/Simulation/Simulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,15 @@ public void SetExplore(string path, string consist, string start, string season,
ExploreConFile = consist;
PreferredLocomotive = preferredLocomotive;
patFileName = Path.ChangeExtension(path, "PAT");
string nativeConsist = Path.ChangeExtension(consist, "CONSIST-OR");
trainFileName = File.Exists(nativeConsist) ? nativeConsist : Path.ChangeExtension(consist, "CON");
switch (Path.GetDirectoryName(consist).ToLowerInvariant())
{
case "consists":
trainFileName = Path.ChangeExtension(consist, "CON");
break;
case "lists":
trainFileName = Path.ChangeExtension(consist, "TRAIN-OR");
break;
}
var time = start.Split(':');
TimeSpan StartTime = new TimeSpan(int.Parse(time[0]), time.Length > 1 ? int.Parse(time[1]) : 0, time.Length > 2 ? int.Parse(time[2]) : 0);
ClockTime = StartTime.TotalSeconds;
Expand All @@ -406,8 +413,15 @@ public void SetExploreThroughActivity(string path, string consist, string start,
ExploreConFile = consist;
PreferredLocomotive = preferredLocomotive;
patFileName = Path.ChangeExtension(path, "PAT");
string nativeConsist = Path.ChangeExtension(consist, "CONSIST-OR");
trainFileName = File.Exists(nativeConsist) ? nativeConsist : Path.ChangeExtension(consist, "CON");
switch (Path.GetDirectoryName(consist).ToLowerInvariant())
{
case "consists":
trainFileName = Path.ChangeExtension(consist, "CON");
break;
case "lists":
trainFileName = Path.ChangeExtension(consist, "TRAIN-OR");
break;
}
var time = start.Split(':');
TimeSpan StartTime = new TimeSpan(int.Parse(time[0]), time.Length > 1 ? int.Parse(time[1]) : 0, time.Length > 2 ? int.Parse(time[2]) : 0);
Activity.Tr_Activity.Tr_Activity_File.Player_Service_Definition.Player_Traffic_Definition.Time = StartTime.Hours + StartTime.Minutes * 60 +
Expand Down Expand Up @@ -1101,7 +1115,7 @@ private Train InitializePlayerTrain()
patFileName = RoutePath + @"\PATHS\" + srvFile.PathID + ".PAT";
OriginalPlayerTrain = train;

train.IsTilting = GenericTrain.IsTilting(trainFileName);
train.IsTilting = GenericTrain.IsTilting(Path.GetFileNameWithoutExtension(trainFileName));

#if ACTIVITY_EDITOR
AIPath aiPath = new AIPath(TDB, TSectionDat, patFileName, TimetableMode, orRouteConfig);
Expand Down

0 comments on commit 225143d

Please sign in to comment.