Index: Orts.Simulation/Simulation/Physics/Train.cs =================================================================== --- Orts.Simulation/Simulation/Physics/Train.cs (revision 4321) +++ Orts.Simulation/Simulation/Physics/Train.cs (working copy) @@ -7786,7 +7786,7 @@ foundSpeedLimit.Clear(); foundSpeedLimit = signalRef.ScanRoute(this, thisElement.TCSectionIndex, offsetStart, thisElement.Direction, - true, -1, false, true, false, false, false, false, true, false, true, IsFreight); + true, -1, false, true, false, false, false, false, true, false, true, IsFreight, true); if (foundSpeedLimit.Count > 0) { @@ -7812,6 +7812,18 @@ AllowedMaxSpeedMpS = Math.Min(allowedMaxSpeedSignalMpS, AllowedMaxSpeedMpS); } } + else if (thisSignal.SignalHeads[0].sigFunction == MstsSignalFunction.SPEED) + { + ObjectSpeedInfo thisSpeedInfo = thisSignal.this_sig_speed(MstsSignalFunction.SPEED); + if (thisSpeedInfo != null && thisSpeedInfo.speed_reset == 1) + { + allowedMaxSpeedSignalMpS = TrainMaxSpeedMpS; + if (Simulator.TimetableMode) + AllowedMaxSpeedMpS = allowedMaxSpeedLimitMpS; + else + AllowedMaxSpeedMpS = Math.Min(allowedMaxTempSpeedLimitMpS, allowedMaxSpeedLimitMpS); + } + } } // check forward along train for speedlimit and signal in direction of train - limit speed if passed @@ -13409,6 +13421,7 @@ float distanceToTrainM = 0.0f; float offset = PresentPosition[0].TCOffset; float sectionStart = -offset; + float progressiveMaxSpeedLimitMpS = allowedMaxSpeedLimitMpS; foreach (TCRouteElement thisElement in ValidRoute[0]) { @@ -13437,8 +13450,11 @@ distanceToTrainM = sectionStart + thisSpeeditem.SignalLocation; - if (distanceToTrainM > 0 && validSpeed > 0) + if (distanceToTrainM > 0 && (validSpeed > 0 || thisSpeedInfo.speed_reset == 1)) { + if (thisSpeedInfo.speed_reset == 1) + validSpeed = progressiveMaxSpeedLimitMpS; + else progressiveMaxSpeedLimitMpS = validSpeed; thisItem = new TrainObjectItem(validSpeed, distanceToTrainM, (TrainObjectItem.SpeedItemType)thisSpeedpost.SpeedPostType()); thisInfo.ObjectInfoForward.Add(thisItem); } @@ -13468,6 +13484,7 @@ float offset = PresentPosition[1].TCOffset; TrackCircuitSection firstSection = signalRef.TrackCircuitList[PresentPosition[1].TCSectionIndex]; float sectionStart = offset - firstSection.Length; + float progressiveMaxSpeedLimitMpS = allowedMaxSpeedLimitMpS; foreach (TCRouteElement thisElement in ValidRoute[1]) { @@ -13495,8 +13512,11 @@ float validSpeed = thisSpeedInfo == null ? -1 : (IsFreight ? thisSpeedInfo.speed_freight : thisSpeedInfo.speed_pass); distanceToTrainM = sectionStart + thisSpeeditem.SignalLocation; - if (distanceToTrainM > 0 && validSpeed > 0) + if (distanceToTrainM > 0 && (validSpeed > 0 || thisSpeedInfo.speed_reset == 1)) { + if (thisSpeedInfo.speed_reset == 1) + validSpeed = progressiveMaxSpeedLimitMpS; + else progressiveMaxSpeedLimitMpS = validSpeed; thisItem = new TrainObjectItem(validSpeed, distanceToTrainM, (TrainObjectItem.SpeedItemType)thisSpeedpost.SpeedPostType()); thisInfo.ObjectInfoBackward.Add(thisItem); } Index: Orts.Simulation/Simulation/Signalling/Signals.cs =================================================================== --- Orts.Simulation/Simulation/Signalling/Signals.cs (revision 4321) +++ Orts.Simulation/Simulation/Signalling/Signals.cs (working copy) @@ -3859,7 +3859,7 @@ public List ScanRoute(Train thisTrain, int firstSectionIndex, float firstOffset, int firstDirection, bool forward, float routeLength, bool honourManualSwitch, bool autoAlign, bool stopAtFacingSignal, bool reservedOnly, bool returnSections, bool searchFacingSignal, bool searchBackwardSignal, bool searchFacingSpeedpost, bool searchBackwardSpeedpost, - bool isFreight) + bool isFreight, bool considerSpeedReset = false) { int sectionIndex = firstSectionIndex; @@ -3976,9 +3976,13 @@ SignalObject thisSpeedpost = thisItem.SignalRef; ObjectSpeedInfo speed_info = thisSpeedpost.this_lim_speed(MstsSignalFunction.SPEED); - - if ((isFreight && speed_info.speed_freight > 0) || (!isFreight && speed_info.speed_pass > 0)) + if (considerSpeedReset) { + var speed_infoR = thisSpeedpost.this_sig_speed(MstsSignalFunction.SPEED); + speed_info.speed_reset = speed_infoR.speed_reset; + } + if ((isFreight && speed_info.speed_freight > 0) || (!isFreight && speed_info.speed_pass > 0) || speed_info.speed_reset == 1) + { if (thisItem.SignalLocation < thisSection.Length - offset) { endOfRoute = true;