Skip to content

Commit

Permalink
Save the computed Track Monitor acceleration to the save file.
Browse files Browse the repository at this point in the history
  • Loading branch information
YoRyan committed Jul 5, 2020
1 parent 0817e32 commit bb67fb6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/Orts.Simulation/Simulation/Physics/Train.cs
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,8 @@ public Train(Simulator simulator, BinaryReader inf)
Number = inf.ReadInt32();
TotalNumber = Math.Max(Number + 1, TotalNumber);
Name = inf.ReadString();
SpeedMpS = inf.ReadSingle();
AccelerationMpSpS.ForceSmoothValue(0f);
SpeedMpS = LastSpeedMpS = inf.ReadSingle();
AccelerationMpSpS.ForceSmoothValue(inf.ReadSingle());
TrainType = (TRAINTYPE)inf.ReadInt32();
if (TrainType == TRAINTYPE.STATIC) ColdStart = true;
MUDirection = (Direction)inf.ReadInt32();
Expand Down Expand Up @@ -986,6 +986,7 @@ public virtual void Save(BinaryWriter outf)
outf.Write(Number);
outf.Write(Name);
outf.Write(SpeedMpS);
outf.Write(AccelerationMpSpS.SmoothedValue);
outf.Write((int)TrainType);
outf.Write((int)MUDirection);
outf.Write(MUThrottlePercent);
Expand Down

0 comments on commit bb67fb6

Please sign in to comment.