# HG changeset patch # User rubidium # Date 2013-02-23 18:15:54 # Node ID 6a94fdea7f7db2145c9c6f7f24006bada7503b01 # Parent 5dce1721551fb74c69c523a561e33b8055dafdfb (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 diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1139,9 +1139,9 @@ CommandCost CmdBuildSingleSignal(TileInd 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);