summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-02-23 18:15:54 +0000
committerrubidium <rubidium@openttd.org>2013-02-23 18:15:54 +0000
commit0c8b215935cd4eb13d60e1c325f59679ec4a0d82 (patch)
tree4b6ebd9cae85ec78b22e5799aef81909c210a86a
parentc58c86efdaadcddfb2fd8ecf3a1ee7ecc9949be1 (diff)
downloadopenttd-0c8b215935cd4eb13d60e1c325f59679ec4a0d82.tar.xz
(svn r25037) -Fix [FS#5480]: green path signals would be shown when building them 'under' a train, and they would keep showing green until they were passed again
-rw-r--r--src/rail_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index e362a132b..45079646c 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -1139,9 +1139,9 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1,
DirtyCompanyInfrastructureWindows(GetTileOwner(tile));
if (IsPbsSignal(sigtype)) {
- /* PBS signals should show red unless they are on a reservation. */
+ /* PBS signals should show red unless they are on reserved tiles without a train. */
uint mask = GetPresentSignals(tile) & SignalOnTrack(track);
- SetSignalStates(tile, (GetSignalStates(tile) & ~mask) | ((HasBit(GetRailReservationTrackBits(tile), track) ? UINT_MAX : 0) & mask));
+ SetSignalStates(tile, (GetSignalStates(tile) & ~mask) | ((HasBit(GetRailReservationTrackBits(tile), track) && EnsureNoVehicleOnGround(tile).Succeeded() ? UINT_MAX : 0) & mask));
}
MarkTileDirtyByTile(tile);
AddTrackToSignalBuffer(tile, track, _current_company);