File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
Source/Orts.Simulation/Simulation/RollingStocks Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -2004,23 +2004,19 @@ public override void Update(float elapsedClockSeconds)
20042004 if ( RemoteControlGroup != - 1 )
20052005 {
20062006 if ( ! LocomotivePowerSupply . MainPowerSupplyOn )
2007- {
20082007 Train . SignalEvent ( PowerSupplyEvent . RaisePantograph , 1 ) ;
20092008
2010- if ( this is MSTSDieselLocomotive )
2009+ if ( this is MSTSDieselLocomotive dieselLocomotive )
2010+ {
2011+ for ( var i = 0 ; i < dieselLocomotive . DieselEngines . Count ; i ++ )
20112012 {
2012- foreach ( DieselEngine de in ( this as MSTSDieselLocomotive ) . DieselEngines )
2013+ var de = dieselLocomotive . DieselEngines [ i ] ;
2014+ if ( ! LocomotivePowerSupply . MainPowerSupplyOn )
20132015 {
20142016 if ( de . State != DieselEngineState . Running )
20152017 de . Initialize ( ) ;
20162018 }
2017- }
2018- }
2019- if ( this is MSTSDieselLocomotive )
2020- {
2021- foreach ( DieselEngine de in ( this as MSTSDieselLocomotive ) . DieselEngines )
2022- {
2023- if ( de . GearBox != null )
2019+ if ( de . GearBox != null )
20242020 de . GearBox . GearBoxOperation = GearBoxOperation . Automatic ;
20252021 }
20262022 }
You can’t perform that action at this time.
0 commit comments