Skip to content

Commit 2290a17

Browse files
committed
Further adjustment to save/restore of DM
1 parent 5ab0e7e commit 2290a17

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,7 @@ public override void Save(BinaryWriter outf)
12671267
outf.Write(RemoteControlGroup);
12681268
outf.Write(DPUnitID);
12691269
outf.Write(PreviousGearBoxNotch);
1270+
outf.Write(previousChangedGearBoxNotch);
12701271

12711272
base.Save(outf);
12721273

@@ -1321,6 +1322,7 @@ public override void Restore(BinaryReader inf)
13211322
RemoteControlGroup = inf.ReadInt32();
13221323
DPUnitID = inf.ReadInt32();
13231324
PreviousGearBoxNotch = inf.ReadInt32();
1325+
previousChangedGearBoxNotch = inf.ReadInt32();
13241326

13251327
base.Restore(inf);
13261328

@@ -3672,10 +3674,6 @@ public virtual void StartGearBoxIncrease()
36723674
AlerterReset(TCSEvent.GearBoxChanged);
36733675
SignalGearBoxChangeEvents();
36743676
}
3675-
3676-
// ChangeGearUp();
3677-
3678-
36793677
}
36803678
}
36813679

@@ -3739,21 +3737,6 @@ public virtual void StartGearBoxDecrease()
37393737
SignalGearBoxChangeEvents();
37403738

37413739
}
3742-
3743-
// pass gearbox command to other locomotives
3744-
foreach (TrainCar car in Train.Cars)
3745-
{
3746-
var locog = car as MSTSDieselLocomotive;
3747-
3748-
if (locog != null && car != this && locog.DieselTransmissionType == MSTSDieselLocomotive.DieselTransmissionTypes.Mechanic)
3749-
{
3750-
locog.GearBoxController.StartDecrease();
3751-
locog.Simulator.Confirmer.ConfirmWithPerCent(CabControl.GearBox, CabSetting.Decrease, GearBoxController.CurrentNotch);
3752-
locog.AlerterReset(TCSEvent.GearBoxChanged);
3753-
locog.SignalGearBoxChangeEvents();
3754-
}
3755-
3756-
}
37573740
}
37583741
}
37593742

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies/DieselEngine.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,6 +1638,7 @@ public void Restore(BinaryReader inf)
16381638
RealRPM = inf.ReadSingle();
16391639
OutputPowerW = inf.ReadSingle();
16401640
DieselTemperatureDeg = inf.ReadSingle();
1641+
GovernorEnabled = inf.ReadBoolean();
16411642

16421643
Locomotive.gearSaved = inf.ReadBoolean(); // read boolean which indicates gear data was saved
16431644

@@ -1654,6 +1655,8 @@ public void Save(BinaryWriter outf)
16541655
outf.Write(RealRPM);
16551656
outf.Write(OutputPowerW);
16561657
outf.Write(DieselTemperatureDeg);
1658+
outf.Write(GovernorEnabled);
1659+
16571660
if (GearBox != null)
16581661
{
16591662
outf.Write(true);

0 commit comments

Comments
 (0)