diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pbs.cpp | 12 | ||||
-rw-r--r-- | src/train_cmd.cpp | 8 | ||||
-rw-r--r-- | src/tunnelbridge_cmd.cpp | 10 |
3 files changed, 26 insertions, 4 deletions
diff --git a/src/pbs.cpp b/src/pbs.cpp index 76cb3b9d6..133293909 100644 --- a/src/pbs.cpp +++ b/src/pbs.cpp @@ -85,7 +85,11 @@ bool TryReserveRailTrack(TileIndex tile, Track t, bool trigger_stations) if (_settings_client.gui.show_track_reservation) { /* show the reserved rail if needed */ - MarkTileDirtyByTile(tile); + if (IsBridgeTile(tile)) { + MarkBridgeDirty(tile); + } else { + MarkTileDirtyByTile(tile); + } } switch (GetTileType(tile)) { @@ -141,7 +145,11 @@ void UnreserveRailTrack(TileIndex tile, Track t) assert((GetTileTrackStatus(tile, TRANSPORT_RAIL, 0) & TrackToTrackBits(t)) != 0); if (_settings_client.gui.show_track_reservation) { - MarkTileDirtyByTile(tile); + if (IsBridgeTile(tile)) { + MarkBridgeDirty(tile); + } else { + MarkTileDirtyByTile(tile); + } } switch (GetTileType(tile)) { diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 45817159b..8f20973b3 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2216,8 +2216,12 @@ static void ClearPathReservation(const Train *v, TileIndex tile, Trackdir track_ SetTunnelBridgeReservation(end, false); if (_settings_client.gui.show_track_reservation) { - MarkTileDirtyByTile(tile); - MarkTileDirtyByTile(end); + if (IsBridge(tile)) { + MarkBridgeDirty(tile); + } else { + MarkTileDirtyByTile(tile); + MarkTileDirtyByTile(end); + } } } } diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index f77ef1333..574f07ae4 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -1481,6 +1481,16 @@ void DrawBridgeMiddle(const TileInfo *ti) AddSortableSpriteToDraw(surface + axis, PAL_NONE, x, y, 16, 16, 0, bridge_z, IsTransparencySet(TO_BRIDGES)); } } + + if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && !IsInvisibilitySet(TO_BRIDGES) && HasTunnelBridgeReservation(rampnorth)) { + if (rti->UsesOverlay()) { + SpriteID overlay = GetCustomRailSprite(rti, ti->tile, RTSG_OVERLAY); + AddSortableSpriteToDraw(overlay + RTO_X + axis, PALETTE_CRASH, ti->x, ti->y, 16, 16, 0, bridge_z, IsTransparencySet(TO_BRIDGES)); + } else { + AddSortableSpriteToDraw(axis == AXIS_X ? rti->base_sprites.single_x : rti->base_sprites.single_y, PALETTE_CRASH, ti->x, ti->y, 16, 16, 0, bridge_z, IsTransparencySet(TO_BRIDGES)); + } + } + EndSpriteCombine(); if (HasCatenaryDrawn(GetRailType(rampsouth))) { |