Skip to content

Commit

Permalink
EOT: follow suggestions of reviewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Csantucci committed Apr 3, 2022
1 parent 80f6486 commit f2b6299
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 29 deletions.
5 changes: 1 addition & 4 deletions Source/Orts.Simulation/Common/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2242,10 +2242,7 @@ public ToggleEOTEmergencyBrakeCommand(CommandLog log)

public override void Redo()
{
if (Receiver?.Train?.EOT != null)
{
Receiver.Train.EOT.EmergencyBrake(!Receiver.Train.EOT.EOTEmergencyBrakingOn);
}
Receiver.Train.EOT?.EmergencyBrake(!Receiver.Train.EOT.EOTEmergencyBrakingOn);
}
}

Expand Down
2 changes: 0 additions & 2 deletions Source/Orts.Simulation/Simulation/AIs/AI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -834,8 +834,6 @@ private AITrain CreateAITrain(Service_Definition sd, Traffic_Traffic_Definition
StartList.InsertTrain(train);
Simulator.StartReference.Add(train.Number);
}
// if (train.Cars[0] is MSTSLocomotive && (train.Cars[0] as MSTSLocomotive).EOTEnabled != MSTSLocomotive.EOTenabled.no)
// train.EOT = new EOT((train.Cars[0] as MSTSLocomotive).EOTEnabled, true, train);
return train;
}

Expand Down
4 changes: 0 additions & 4 deletions Source/Orts.Simulation/Simulation/Physics/Train.cs
Original file line number Diff line number Diff line change
Expand Up @@ -916,10 +916,6 @@ public Train(Simulator simulator, BinaryReader inf)
InitialSpeed = inf.ReadSingle();
IsPathless = inf.ReadBoolean();

/* var hasEOT = inf.ReadInt32();
if (hasEOT == 1)
EOT = new EOT(inf, this);*/

if (TrainType != TRAINTYPE.REMOTE)
{
// restore leadlocomotive
Expand Down
19 changes: 0 additions & 19 deletions Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/EOT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,6 @@ public EOT(Simulator simulator, string wagPath)
DelayTimer = new Timer(this);
}

/* public EOT(MSTSLocomotive.EOTenabled eotEnabled, bool armed, Train train)
{
Train = train;
EOTState = EOTstate.Disarmed;
EOTType = eotEnabled;
ID = IDRandom.Next(0, 99999);
if (armed)
EOTState = EOTstate.Armed;
DelayTimer = new Timer(this);
}*/

/* public EOT(BinaryReader inf, Train train)
{
Train = train;
ID = inf.ReadInt32();
EOTState = (EOTstate)(inf.ReadInt32());
DelayTimer = new Timer(this);
}*/

public override void Initialize()
{
base.Initialize();
Expand Down

0 comments on commit f2b6299

Please sign in to comment.