Skip to content

Commit 757b1be

Browse files
committed
Provide transitory functionality for existing scripts
1 parent 4b70d86 commit 757b1be

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Source/Orts.Simulation/Simulation/Physics/Train.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public TRAIN_CONTROL ControlMode
348348
/// <summary>
349349
/// Set when the train is out of control
350350
/// </summary>
351-
private TRAIN_CONTROL ControlModeBeforeOutOfControl = TRAIN_CONTROL.UNDEFINED;
351+
public TRAIN_CONTROL ControlModeBeforeOutOfControl = TRAIN_CONTROL.UNDEFINED;
352352

353353
public enum OUTOFCONTROL
354354
{

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/TrainControlSystem.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,15 @@ public void Initialize()
539539
CustomizedCabviewControlNames[id] = value;
540540
}
541541
};
542-
Script.RequestToggleManualMode = () => Locomotive.Train.RequestToggleManualMode();
542+
Script.RequestToggleManualMode = () =>
543+
{
544+
if (Locomotive.Train.ControlMode == Train.TRAIN_CONTROL.OUT_OF_CONTROL && Locomotive.Train.ControlModeBeforeOutOfControl == Train.TRAIN_CONTROL.EXPLORER)
545+
{
546+
Trace.TraceWarning("RequestToggleManualMode() is deprecated for explorer mode. Please use ResetOutOfControlMode() instead");
547+
Locomotive.Train.ManualResetOutOfControlMode();
548+
}
549+
else Locomotive.Train.RequestToggleManualMode();
550+
};
543551
Script.ResetOutOfControlMode = () => Locomotive.Train.ManualResetOutOfControlMode();
544552

545553
// TrainControlSystem INI configuration file

0 commit comments

Comments
 (0)