Fix signalled bridge/tunnel not always being redrawn on (un)reservation.

This commit is contained in:
Jonathan G Rennison 2016-04-28 22:19:35 +01:00
parent 3ae94d857c
commit 17f74e4c51
2 changed files with 3 additions and 0 deletions

View File

@ -126,6 +126,7 @@ bool TryReserveRailTrack(TileIndex tile, Track t, bool trigger_stations)
if (GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL && !GetTunnelBridgeReservationTrackBits(tile)) { if (GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL && !GetTunnelBridgeReservationTrackBits(tile)) {
SetTunnelBridgeReservation(tile, true); SetTunnelBridgeReservation(tile, true);
if (IsTunnelBridgeExit(tile) && IsTunnelBridgePBS(tile)) SetTunnelBridgeExitGreen(tile, true); if (IsTunnelBridgeExit(tile) && IsTunnelBridgePBS(tile)) SetTunnelBridgeExitGreen(tile, true);
MarkTileDirtyByTile(tile);
return true; return true;
} }
break; break;
@ -181,6 +182,7 @@ void UnreserveRailTrack(TileIndex tile, Track t)
if (GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL) { if (GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL) {
SetTunnelBridgeReservation(tile, false); SetTunnelBridgeReservation(tile, false);
if (IsTunnelBridgeExit(tile) && IsTunnelBridgePBS(tile)) SetTunnelBridgeExitGreen(tile, false); if (IsTunnelBridgeExit(tile) && IsTunnelBridgePBS(tile)) SetTunnelBridgeExitGreen(tile, false);
MarkTileDirtyByTile(tile);
} }
break; break;

View File

@ -3231,6 +3231,7 @@ static bool CheckTrainStayInWormHolePathReserve(Train *t, TileIndex tile)
if (reserved == TRACKDIR_BIT_NONE) { if (reserved == TRACKDIR_BIT_NONE) {
/* next tile is not reserved, so reserve the exit tile */ /* next tile is not reserved, so reserve the exit tile */
SetTunnelBridgeReservation(tile, true); SetTunnelBridgeReservation(tile, true);
MarkTileDirtyByTile(tile);
} }
} }
bool ok = TryPathReserve(t); bool ok = TryPathReserve(t);