Skip to content

Commit

Permalink
Some logic fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
winup-zhou committed Jan 31, 2025
1 parent ca7907f commit dca6ad9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions JR_SotetsuSignal/Tick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ public override void Tick(TimeSpan elapsed) {
panel[Config.Panel_brakeoutput] = AtsHandles.BrakeNotch;
} else {
if (StandAloneMode) {
if (!SignalEnable && Keyin)
if (!SignalEnable && Keyin && handles.ReverserPosition != ReverserPosition.N && handles.BrakeNotch != vehicleSpec.BrakeNotches + 1)
SignalEnable = true;
AtsHandles.BrakeNotch = vehicleSpec.BrakeNotches + 1;
AtsHandles.ReverserPosition = ReverserPosition.N;
} else {
Keyin = corePlugin.KeyPos == MetroAts.KeyPosList.JR || corePlugin.KeyPos == MetroAts.KeyPosList.Sotetsu;
if (!SignalEnable && Keyin && (corePlugin.SignalSWPos == MetroAts.SignalSWList.JR || corePlugin.SignalSWPos == MetroAts.SignalSWList.Sotetsu))
if (!SignalEnable && Keyin && (corePlugin.SignalSWPos == MetroAts.SignalSWList.JR || corePlugin.SignalSWPos == MetroAts.SignalSWList.Sotetsu)
&& handles.ReverserPosition != ReverserPosition.N && handles.BrakeNotch != vehicleSpec.BrakeNotches + 1)
SignalEnable = true;
}

Expand Down
2 changes: 1 addition & 1 deletion TokyuSignal/Signals/ATC-P/Tick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static void Tick(VehicleState state, Section CurrentSection, Section Next
BrakeCommand = TokyuSignal.vehicleSpec.BrakeNotches + 1;
}
} else {
if (state.Time.TotalMilliseconds - InitializeStartTime.TotalMilliseconds < 5000) {
if (state.Time.TotalMilliseconds - InitializeStartTime.TotalMilliseconds < 3000) {
ATC_X = true;
ATC_Stop = ATC_Proceed = ATC_P = false;
if (!Config.ATCLimitUseNeedle) {
Expand Down

0 comments on commit dca6ad9

Please sign in to comment.