Skip to content

Commit b00b918

Browse files
authored
Merge pull request #562 from pzgulyas/tcs-script-fix
Remove the locomotive handle from the script, because no interface function can allow access to any internal structure.
2 parents f70793e + 44f35b4 commit b00b918

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

Source/Orts.Simulation/Common/Scripting/TrainControlSystem.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,6 @@ public abstract class TrainControlSystem : AbstractTrainScriptClass
300300
/// Get distance of next station if any, else max float value
301301
/// </summary>
302302
public Func<float> NextStationDistanceM;
303-
/// <summary>
304-
/// Get locomotive handle
305-
/// </summary>
306-
public Func<MSTSLocomotive> Locomotive;
307303

308304
/// <summary>
309305
/// (float targetDistanceM, float targetSpeedMpS, float slope, float delayS, float decelerationMpS2)

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ public void Initialize()
389389
Script.GetControlMode = () => (TRAIN_CONTROL)(int)Locomotive.Train.ControlMode;
390390
Script.NextStationName = () => Locomotive.Train.StationStops != null && Locomotive.Train.StationStops.Count > 0 ? Locomotive.Train.StationStops[0].PlatformItem.Name : "";
391391
Script.NextStationDistanceM = () => Locomotive.Train.StationStops != null && Locomotive.Train.StationStops.Count > 0 ? Locomotive.Train.StationStops[0].DistanceToTrainM : float.MaxValue;
392-
Script.Locomotive = () => Locomotive;
393392

394393
// TrainControlSystem functions
395394
Script.SpeedCurve = (arg1, arg2, arg3, arg4, arg5) => SpeedCurve(arg1, arg2, arg3, arg4, arg5);

0 commit comments

Comments
 (0)