Skip to content

Commit

Permalink
Automatic merge of T1.5.1-340-g907936445 and 8 pull requests
Browse files Browse the repository at this point in the history
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 1edb2e5: Improvements for air brakes
- Pull request #751 at 00981a2: Web interface to control cab controls with external hardware
- Pull request #767 at 4cb5c77: Refine sunrise and sunset
- Pull request #803 at 7157e08: Various adjustments to steam adhesion
- Pull request #807 at 791c0a3: fix: Stop z-fighting by pushing world/view/projection multiplications onto the GPU
- Pull request #809 at f67822a: Some on-screen messages not suppressed, Bug #2008012
- Pull request #810 at e2ad93e: Bug fix for AI train WP restart events don't work after save
  • Loading branch information
openrails-bot committed Mar 9, 2023
10 parents e022a81 + 9079364 + fb9079e + 1edb2e5 + 00981a2 + 4cb5c77 + 7157e08 + 791c0a3 + f67822a + e2ad93e commit 7869578
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Source/Orts.Simulation/Simulation/AIs/AIAuxAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ public class AIAuxActionsRef : AuxActionRef
public float RequiredSpeedMpS;
public float RequiredDistance;
public int Delay;
public int OriginalDelay;
public int EndSignalIndex { get; protected set; }

public AUX_ACTION NextAction = AUX_ACTION.NONE;
Expand Down Expand Up @@ -888,6 +889,7 @@ public AIActionWPRef(Train thisTrain, BinaryReader inf)
: base (thisTrain, inf)
{
Delay = inf.ReadInt32();
OriginalDelay = inf.ReadInt32();
NextAction = AUX_ACTION.WAITING_POINT;
#if WITH_PATH_DEBUG
File.AppendAllText(@"C:\temp\checkpath.txt", "\tRestore one WPAuxAction" +
Expand Down Expand Up @@ -915,6 +917,7 @@ public override void save(BinaryWriter outf, int cnt)
#endif
base.save(outf, cnt);
outf.Write(Delay);
outf.Write(OriginalDelay);
}

public override AIActionItem Handler(params object[] list)
Expand Down Expand Up @@ -2733,4 +2736,4 @@ public override AITrain.AI_MOVEMENT_STATE ProcessAction(Train thisTrain, int pre
}

#endregion
}
}
3 changes: 2 additions & 1 deletion Source/Orts.Simulation/Simulation/AIs/AITrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4027,6 +4027,7 @@ public void BuildWaitingPointList(float clearingDistanceM)
RandomizedWPDelay(ref randomizedDelay);
}
action.SetDelay(randomizedDelay);
action.OriginalDelay = action.Delay;
AuxActionsContain.Add(action);
if (insertSigDelegate && (waitingPoint[2] != 60002) && signalIndex[iWait] > -1)
{
Expand Down Expand Up @@ -6686,7 +6687,7 @@ public void RestartWaitingTrain(RestartWaitingTrain restartWaitingTrain)
var matchingWPDelay = restartWaitingTrain.MatchingWPDelay;
int presentTime = Convert.ToInt32(Math.Floor(Simulator.ClockTime));
var roughActualDepart = presentTime + delayToRestart;
if (MovementState == AITrain.AI_MOVEMENT_STATE.HANDLE_ACTION && (((nextActionInfo as AuxActionWPItem).ActionRef as AIActionWPRef).Delay == matchingWPDelay ||
if (MovementState == AITrain.AI_MOVEMENT_STATE.HANDLE_ACTION && (((nextActionInfo as AuxActionWPItem).ActionRef as AIActionWPRef).OriginalDelay == matchingWPDelay ||
(AuxActionsContain.specRequiredActions.Count > 0 && ((AuxActSigDelegate)(AuxActionsContain.specRequiredActions).First.Value).currentMvmtState == AITrain.AI_MOVEMENT_STATE.HANDLE_ACTION &&
(((AuxActSigDelegate)(AuxActionsContain.specRequiredActions).First.Value).ActionRef as AIActSigDelegateRef).Delay == matchingWPDelay)))
{
Expand Down

0 comments on commit 7869578

Please sign in to comment.