Fix unreserving through a green PBS signal not setting the state to red.
This also had the side effect of failed reservation attempts through a reserve-through signal leaving the signal erroneously set to green.
This commit is contained in:
14
src/pbs.cpp
14
src/pbs.cpp
@@ -154,6 +154,20 @@ bool TryReserveRailTrack(TileIndex tile, Track t, bool trigger_stations)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lift the reservation of a specific trackdir on a tile
|
||||
* This also sets PBS signals to red if unreserving through the facing track direction
|
||||
* @param tile the tile
|
||||
* @param t the track
|
||||
*/
|
||||
void UnreserveRailTrackdir(TileIndex tile, Trackdir td)
|
||||
{
|
||||
if (HasPbsSignalOnTrackdir(tile, td)) {
|
||||
SetSignalStateByTrackdir(tile, td, SIGNAL_STATE_RED);
|
||||
}
|
||||
UnreserveRailTrack(tile, TrackdirToTrack(td));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lift the reservation of a specific track on a tile
|
||||
* @param tile the tile
|
||||
|
Reference in New Issue
Block a user