From 0c8b215935cd4eb13d60e1c325f59679ec4a0d82 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 23 Feb 2013 18:15:54 +0000 Subject: (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 --- src/rail_cmd.cpp | 4 ++-- 1 file 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); -- cgit v1.2.3-70-g09d2