|
@@ -1025,15 +1025,15 @@ static void* EnumFindVehBlockingOvertake
|
|
|
*
|
|
|
* @param od Information about the tile and the involved vehicles
|
|
|
* @return true if we have to abort overtaking
|
|
|
*/
|
|
|
static bool CheckRoadBlockedForOvertaking(OvertakeData *od)
|
|
|
{
|
|
|
uint32 ts = GetTileTrackStatus(od->tile, TRANSPORT_ROAD, od->v->u.road.compatible_roadtypes);
|
|
|
TrackdirBits trackdirbits = (TrackdirBits)(ts & TRACKDIR_BIT_MASK);
|
|
|
TrackdirBits red_signals = (TrackdirBits)((ts >> 16) & TRACKDIR_BIT_MASK); // barred level crossing
|
|
|
TrackStatus ts = GetTileTrackStatus(od->tile, TRANSPORT_ROAD, od->v->u.road.compatible_roadtypes);
|
|
|
TrackdirBits trackdirbits = TrackStatusToTrackdirBits(ts);
|
|
|
TrackdirBits red_signals = TrackStatusToRedSignals(ts); // barred level crossing
|
|
|
TrackBits trackbits = TrackdirBitsToTrackBits(trackdirbits);
|
|
|
|
|
|
/* Track does not continue along overtaking direction || track has junction || levelcrossing is barred */
|
|
|
if (!HasBit(trackdirbits, od->trackdir) || (trackbits & ~TRACK_BIT_CROSS) || (red_signals != TRACKDIR_BIT_NONE)) return true;
|
|
|
|
|
|
/* Are there more vehicles on the tile except the two vehicles involved in overtaking */
|
|
@@ -1156,15 +1156,15 @@ static Trackdir RoadFindPathToDest(Vehic
|
|
|
#define return_track(x) { best_track = (Trackdir)x; goto found_best_track; }
|
|
|
|
|
|
TileIndex desttile;
|
|
|
FindRoadToChooseData frd;
|
|
|
Trackdir best_track;
|
|
|
|
|
|
uint32 r = GetTileTrackStatus(tile, TRANSPORT_ROAD, v->u.road.compatible_roadtypes);
|
|
|
TrackdirBits signal = (TrackdirBits)GB(r, 16, 16);
|
|
|
TrackdirBits trackdirs = (TrackdirBits)GB(r, 0, 16);
|
|
|
TrackStatus ts = GetTileTrackStatus(tile, TRANSPORT_ROAD, v->u.road.compatible_roadtypes);
|
|
|
TrackdirBits red_signals = TrackStatusToRedSignals(ts); // crossing
|
|
|
TrackdirBits trackdirs = TrackStatusToTrackdirBits(ts);
|
|
|
|
|
|
if (IsTileType(tile, MP_ROAD)) {
|
|
|
if (IsRoadDepot(tile) && (!IsTileOwner(tile, v->owner) || GetRoadDepotDirection(tile) == enterdir || (GetRoadTypes(tile) & v->u.road.compatible_roadtypes) == 0)) {
|
|
|
/* Road depot owned by another player or with the wrong orientation */
|
|
|
trackdirs = TRACKDIR_BIT_NONE;
|
|
|
}
|
|
@@ -1299,13 +1299,13 @@ do_it:;
|
|
|
}
|
|
|
} break;
|
|
|
}
|
|
|
|
|
|
found_best_track:;
|
|
|
|
|
|
if (HasBit(signal, best_track)) return INVALID_TRACKDIR;
|
|
|
if (HasBit(red_signals, best_track)) return INVALID_TRACKDIR;
|
|
|
|
|
|
return best_track;
|
|
|
}
|
|
|
|
|
|
static uint RoadFindPathToStop(const Vehicle *v, TileIndex tile)
|
|
|
{
|