Skip to content

Commit

Permalink
fix: wrong updateing signals when partly resetting pathway
Browse files Browse the repository at this point in the history
  • Loading branch information
Uhutown committed Oct 22, 2024
1 parent 2d28a3c commit 5dc99d6
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,16 @@ protected void updateSignalStates() {
final MainSignalIdentifier startSignal = data.getStartSignal();
final MainSignalIdentifier endSignal = data.getEndSignal();
if (startSignal != null) {
if (isBlocked)
return;
final SignalState previous = startSignal.state;
startSignal.state = SignalState.GREEN;
if (!startSignal.state.equals(previous))
greenSignals.add(startSignal);
data.getPreSignals().forEach(signalIdent -> {
signalIdent.state = SignalState.GREEN;
greenSignals.add(signalIdent);
});
if (!isBlocked) {
final SignalState previous = startSignal.state;
startSignal.state = SignalState.GREEN;
if (!startSignal.state.equals(previous))
greenSignals.add(startSignal);
data.getPreSignals().forEach(signalIdent -> {
signalIdent.state = SignalState.GREEN;
greenSignals.add(signalIdent);
});
}
}
final Map<BlockPosSignalHolder, OtherSignalIdentifier> distantSignalPositions = data
.getOtherSignals();
Expand Down

0 comments on commit 5dc99d6

Please sign in to comment.