Skip to content

Commit

Permalink
fix: problem
Browse files Browse the repository at this point in the history
s with interSignalBox
  • Loading branch information
Uhutown committed Oct 13, 2024
1 parent e8aa04a commit c1e4fe7
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import com.google.common.collect.Maps;
import com.troblecodings.core.NBTWrapper;
import com.troblecodings.signals.OpenSignalsMain;
import com.troblecodings.signals.blocks.Signal;
import com.troblecodings.signals.core.BlockPosSignalHolder;
import com.troblecodings.signals.core.StateInfo;
Expand Down Expand Up @@ -169,7 +170,16 @@ protected void setSignals(final SignalStateInfo lastSignal) {
public void compact(final Point point) {
super.compact(point);
if (pathwayToBlock != null) {
pathwayToBlock.loadTileAndExecute(tile -> pathwayToReset = this);
pathwayToBlock.loadTileAndExecute(tile -> {
final InterSignalBoxPathway pw = (InterSignalBoxPathway) tile.getSignalBoxGrid()
.getPathwayByLastPoint(pathwayToBlock.getLastPoint());
if (pw == null) {
OpenSignalsMain.getLogger()
.error("PW to block is zero! This should't be the case!");
return;
}
pw.setOtherPathwayToReset(this);
});
}
}

Expand Down

0 comments on commit c1e4fe7

Please sign in to comment.