File tree 1 file changed +6
-10
lines changed
Source/Orts.Simulation/Simulation/RollingStocks
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)
2004
2004
if ( RemoteControlGroup != - 1 )
2005
2005
{
2006
2006
if ( ! LocomotivePowerSupply . MainPowerSupplyOn )
2007
- {
2008
2007
Train . SignalEvent ( PowerSupplyEvent . RaisePantograph , 1 ) ;
2009
2008
2010
- if ( this is MSTSDieselLocomotive )
2009
+ if ( this is MSTSDieselLocomotive dieselLocomotive )
2010
+ {
2011
+ for ( var i = 0 ; i < dieselLocomotive . DieselEngines . Count ; i ++ )
2011
2012
{
2012
- foreach ( DieselEngine de in ( this as MSTSDieselLocomotive ) . DieselEngines )
2013
+ var de = dieselLocomotive . DieselEngines [ i ] ;
2014
+ if ( ! LocomotivePowerSupply . MainPowerSupplyOn )
2013
2015
{
2014
2016
if ( de . State != DieselEngineState . Running )
2015
2017
de . Initialize ( ) ;
2016
2018
}
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 )
2024
2020
de . GearBox . GearBoxOperation = GearBoxOperation . Automatic ;
2025
2021
}
2026
2022
}
You can’t perform that action at this time.
0 commit comments