File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed
Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -1586,14 +1586,7 @@ public void Restore(BinaryReader inf)
15861586 OutputPowerW = inf . ReadSingle ( ) ;
15871587 DieselTemperatureDeg = inf . ReadSingle ( ) ;
15881588 GovernorEnabled = inf . ReadBoolean ( ) ;
1589-
1590- bool gearSaved = inf . ReadBoolean ( ) ; // read boolean which indicates gear data was saved
1591-
1592- if ( gearSaved )
1593- {
1594- GearBox = new GearBox ( this ) ;
1595- GearBox . Restore ( inf ) ;
1596- }
1589+ GearBox ? . Restore ( inf ) ;
15971590 }
15981591
15991592 public void Save ( BinaryWriter outf )
@@ -1603,16 +1596,7 @@ public void Save(BinaryWriter outf)
16031596 outf . Write ( OutputPowerW ) ;
16041597 outf . Write ( DieselTemperatureDeg ) ;
16051598 outf . Write ( GovernorEnabled ) ;
1606-
1607- if ( GearBox != null )
1608- {
1609- outf . Write ( true ) ;
1610- GearBox . Save ( outf ) ;
1611- }
1612- else
1613- {
1614- outf . Write ( false ) ;
1615- }
1599+ GearBox ? . Save ( outf ) ;
16161600 }
16171601
16181602 /// <summary>
You can’t perform that action at this time.
0 commit comments