@@ -2248,6 +2248,7 @@ public override void SetNextStationAction(bool fromAutopilotSwitch = false)
22482248 AIActionItem newAction = new AIActionItem(null, AIActionItem.AI_ACTION_TYPE.STATION_STOP);
22492249 newAction.SetParam(distancesM[1], 0.0f, distancesM[0], DistanceTravelledM);
22502250 requiredActions.InsertAction(newAction);
2251+ ApproachTriggerSet = false;
22512252
22522253#if DEBUG_REPORTS
22532254 if (StationStops[0].ActualStopType == StationStop.STOPTYPE.STATION_STOP)
@@ -3980,6 +3981,7 @@ public override void UpdateStationState(float elapsedClockSeconds, int presentTi
39803981 Delay = TimeSpan.FromSeconds((presentTime - thisStation.DepartTime) % (24 * 3600));
39813982 }
39823983 }
3984+ if (Cars[0] is MSTSLocomotive) Cars[0].SignalEvent(Event.AITrainLeavingStation);
39833985
39843986#if DEBUG_REPORTS
39853987 DateTime baseDTd = new DateTime();
@@ -4501,7 +4503,7 @@ public override void UpdateBrakingState(float elapsedClockSeconds, int presentTi
45014503 }
45024504 else if (nextActionInfo.RequiredSpeedMpS == 0)
45034505 {
4504- // Check if stopped at signal
4506+ // Check if stopped at signal
45054507 NextStopDistanceM = distanceToGoM;
45064508 float stopDistanceM = signalApproachDistanceM;
45074509
@@ -4571,6 +4573,13 @@ public override void UpdateBrakingState(float elapsedClockSeconds, int presentTi
45714573 }
45724574 }
45734575
4576+ if (nextActionInfo != null && nextActionInfo.NextAction == AIActionItem.AI_ACTION_TYPE.STATION_STOP &&
4577+ distanceToGoM < 150 + StationStops[0].PlatformItem.Length && !ApproachTriggerSet)
4578+ {
4579+ if (Cars[0] is MSTSLocomotive) Cars[0].SignalEvent(Event.AITrainApproachingStation);
4580+ ApproachTriggerSet = true;
4581+ }
4582+
45744583 // Keep speed within required speed band
45754584 // Preset, also valid for reqSpeed > 0
45764585 float lowestSpeedMpS = requiredSpeedMpS;
0 commit comments