Skip to content

Commit

Permalink
Automatic merge of T1.5.1-495-g55f992dcd and 10 pull requests
Browse files Browse the repository at this point in the history
- Pull request #570 at 7269d24: Experimental glTF 2.0 support with PBR lighting
- Pull request #757 at d9d75f4: Unify RailDriver code implementations
- Pull request #799 at dc03850: Consolidated wind simulation
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #829 at 434af02: Improvements for air brakes #3 - Emergency valves
- Pull request #831 at 9417e1b: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #846 at 9668051: Initialize cars before restore
- Pull request #849 at 0d4e3da: Contributed projects and forking clarity
- Pull request #850 at 1605667: Correct output of sound system info
  • Loading branch information
openrails-bot committed Jul 4, 2023
12 parents 2ae1346 + 55f992d + 7269d24 + d9d75f4 + dc03850 + cc3af66 + 434af02 + 9417e1b + d00beb9 + 9668051 + 0d4e3da + 1605667 commit 77c8ab3
Showing 1 changed file with 2 additions and 18 deletions.
Expand Up @@ -1586,14 +1586,7 @@ public void Restore(BinaryReader inf)
OutputPowerW = inf.ReadSingle();
DieselTemperatureDeg = inf.ReadSingle();
GovernorEnabled = inf.ReadBoolean();

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

if (gearSaved)
{
GearBox = new GearBox(this);
GearBox.Restore(inf);
}
GearBox?.Restore(inf);
}

public void Save(BinaryWriter outf)
Expand All @@ -1603,16 +1596,7 @@ public void Save(BinaryWriter outf)
outf.Write(OutputPowerW);
outf.Write(DieselTemperatureDeg);
outf.Write(GovernorEnabled);

if (GearBox != null)
{
outf.Write(true);
GearBox.Save(outf);
}
else
{
outf.Write(false);
}
GearBox?.Save(outf);
}

/// <summary>
Expand Down

0 comments on commit 77c8ab3

Please sign in to comment.