Codechange: split GetRoadDir as bays have DiagDir and drive throughs have Axis

This commit is contained in:
Rubidium
2024-10-22 23:25:07 +02:00
committed by rubidium42
parent d6aa09f96a
commit c9819f8957
11 changed files with 100 additions and 56 deletions

View File

@@ -1252,7 +1252,9 @@ static bool CanRoadContinueIntoNextTile(const Town *t, const TileIndex tile, con
/* If the next tile is a station, allow if it's a road station facing the proper direction. Otherwise return false. */
if (IsTileType(next_tile, MP_STATION)) {
/* If the next tile is a road station, allow if it can be entered by the new tunnel/bridge, otherwise disallow. */
return IsAnyRoadStop(next_tile) && (GetRoadStopDir(next_tile) == ReverseDiagDir(road_dir) || (IsDriveThroughStopTile(next_tile) && GetRoadStopDir(next_tile) == road_dir));
if (IsDriveThroughStopTile(next_tile)) return GetDriveThroughStopAxis(next_tile) == DiagDirToAxis(road_dir);
if (IsBayRoadStopTile(next_tile)) return GetBayRoadStopDir(next_tile) == ReverseDiagDir(road_dir);
return false;
}
/* If the next tile is a road depot, allow if it's facing the right way. */