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 authored Oct 22, 2024
1 parent ef6ec56 commit 084aed6
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,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 Expand Up @@ -734,4 +734,4 @@ public boolean isInterSignalBoxPathway() {
public SignalBoxGrid getGrid() {
return grid;
}
}
}

0 comments on commit 084aed6

Please sign in to comment.