1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-24 04:34:16 +01:00

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

@@ -897,7 +897,7 @@ static Trackdir RoadFindPathToDest(RoadVehicle *v, TileIndex tile, DiagDirection
} else if (IsTileType(tile, MP_STATION) && IsBayRoadStopTile(tile)) {
/* Standard road stop (drive-through stops are treated as normal road) */
if (!IsTileOwner(tile, v->owner) || GetRoadStopDir(tile) == enterdir || v->HasArticulatedPart()) {
if (!IsTileOwner(tile, v->owner) || GetBayRoadStopDir(tile) == enterdir || v->HasArticulatedPart()) {
/* different station owner or wrong orientation or the vehicle has articulated parts */
trackdirs = TRACKDIR_BIT_NONE;
} else {
@@ -1746,7 +1746,7 @@ Trackdir RoadVehicle::GetVehicleTrackdir() const
if (IsBayRoadStopTile(this->tile)) {
/* We'll assume the road vehicle is facing outwards */
return DiagDirToDiagTrackdir(GetRoadStopDir(this->tile)); // Road vehicle in a station
return DiagDirToDiagTrackdir(GetBayRoadStopDir(this->tile)); // Road vehicle in a station
}
/* Drive through road stops / wormholes (tunnels) */