1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-01 10:59:12 +00:00

(svn r19369) -Codechange: EnsureNoTrainOnTrackBits() returns a CommandCost now.

This commit is contained in:
alberth
2010-03-07 18:24:41 +00:00
parent f0de6366ba
commit 55f8d5d802
4 changed files with 9 additions and 6 deletions

View File

@@ -301,7 +301,8 @@ static SigFlags ExploreSegment(Owner owner)
if (tracks == TRACK_BIT_HORZ || tracks == TRACK_BIT_VERT) { // there is exactly one incidating track, no need to check
tracks = tracks_masked;
if (!(flags & SF_TRAIN) && !EnsureNoTrainOnTrackBits(tile, tracks)) flags |= SF_TRAIN;
/* If no train detected yet, and there is not no train -> there is a train -> set the flag */
if (!(flags & SF_TRAIN) && EnsureNoTrainOnTrackBits(tile, tracks).Failed()) flags |= SF_TRAIN;
} else {
if (tracks_masked == TRACK_BIT_NONE) continue; // no incidating track
if (!(flags & SF_TRAIN) && HasVehicleOnPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN;