Changeset - r20074:6a94fdea7f7d
[Not reviewed]
master
0 1 0
rubidium - 12 years ago 2013-02-23 18:15:54
rubidium@openttd.org
(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
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/rail_cmd.cpp
Show inline comments
 
@@ -1136,15 +1136,15 @@ CommandCost CmdBuildSingleSignal(TileInd
 

	
 
		/* Add new signal infrastructure count. */
 
		Company::Get(GetTileOwner(tile))->infrastructure.signal += CountBits(GetPresentSignals(tile));
 
		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);
 
		YapfNotifyTrackLayoutChange(tile, track);
 
		if (v != NULL) {
 
			/* Extend the train's path if it's not stopped or loading, or not at a safe position. */
0 comments (0 inline, 0 general)