progsig: Fix signal dependency being left dangling after cycling side.

If the target of a programmable signal dependency was cycled to the
other side, the dependency was not cleared.
As the dependency was then no longer valid, it was not cleared by the
programmable signal.
Deleting the programmable signal and then the target signal resulted
in a crash.
This commit is contained in:
Jonathan G Rennison 2016-01-31 20:56:11 +00:00
parent 769b8ae096
commit 1e9433e0ff

View File

@ -1120,6 +1120,8 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1,
SetPresentSignals(tile, (GetPresentSignals(tile) & ~SignalOnTrack(track)) | KillFirstBit(SignalOnTrack(track)));
}
} else {
/* programmable signal dependencies are invalidated when the signal direction is changed */
CheckRemoveSignal(tile, track);
/* cycle the signal side: both -> left -> right -> both -> ... */
CycleSignalSide(tile, track);
/* Query current signal type so the check for PBS signals below works. */