diff --git a/src/openttd.cpp b/src/openttd.cpp index 19eb01432f..3b6c303de6 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1220,7 +1220,7 @@ static void CheckCaches() /* Strict checking of the road stop cache entries */ for (const RoadStop *rs : RoadStop::Iterate()) { - if (IsStandardRoadStopTile(rs->xy)) continue; + if (IsBayRoadStopTile(rs->xy)) continue; assert(rs->GetEntry(DIAGDIR_NE) != rs->GetEntry(DIAGDIR_NW)); rs->GetEntry(DIAGDIR_NE)->CheckIntegrity(rs); diff --git a/src/pathfinder/follow_track.hpp b/src/pathfinder/follow_track.hpp index ce15790d41..3cdb3625b5 100644 --- a/src/pathfinder/follow_track.hpp +++ b/src/pathfinder/follow_track.hpp @@ -247,7 +247,7 @@ protected: inline bool CanExitOldTile() { /* road stop can be left at one direction only unless it's a drive-through stop */ - if (IsRoadTT() && IsStandardRoadStopTile(m_old_tile)) { + if (IsRoadTT() && IsBayRoadStopTile(m_old_tile)) { DiagDirection exitdir = GetRoadStopDir(m_old_tile); if (exitdir != m_exitdir) { m_err = EC_NO_WAY; @@ -278,7 +278,7 @@ protected: /** return true if we can enter m_new_tile from m_exitdir */ inline bool CanEnterNewTile() { - if (IsRoadTT() && IsStandardRoadStopTile(m_new_tile)) { + if (IsRoadTT() && IsBayRoadStopTile(m_new_tile)) { /* road stop can be entered from one direction only unless it's a drive-through stop */ DiagDirection exitdir = GetRoadStopDir(m_new_tile); if (ReverseDiagDir(exitdir) != m_exitdir) { @@ -402,7 +402,7 @@ protected: /* Single tram bits and standard road stops cause reversing. */ if (IsRoadTT() && ((IsTram() && GetSingleTramBit(m_old_tile) == ReverseDiagDir(m_exitdir)) || - (IsStandardRoadStopTile(m_old_tile) && GetRoadStopDir(m_old_tile) == ReverseDiagDir(m_exitdir)))) { + (IsBayRoadStopTile(m_old_tile) && GetRoadStopDir(m_old_tile) == ReverseDiagDir(m_exitdir)))) { /* reverse */ m_new_tile = m_old_tile; m_new_td_bits = TrackdirToTrackdirBits(ReverseTrackdir(m_old_td)); diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp index 0868d97519..b8f6528f12 100644 --- a/src/pathfinder/npf/npf.cpp +++ b/src/pathfinder/npf/npf.cpp @@ -695,7 +695,7 @@ static bool CanEnterTileOwnerCheck(Owner owner, TileIndex tile, DiagDirection en if (IsTileType(tile, MP_RAILWAY) || // Rail tile (also rail depot) HasStationTileRail(tile) || // Rail station tile/waypoint IsRoadDepotTile(tile) || // Road depot tile - IsStandardRoadStopTile(tile)) { // Road station tile (but not drive-through stops) + IsBayRoadStopTile(tile)) { // Road station tile (but not drive-through stops) return IsTileOwner(tile, owner); // You need to own these tiles entirely to use them } @@ -768,7 +768,7 @@ static DiagDirection GetTileSingleEntry(TileIndex tile, TransportType type, uint if (type != TRANSPORT_WATER && IsDepotTypeTile(tile, type)) return GetDepotDirection(tile, type); if (type == TRANSPORT_ROAD) { - if (IsStandardRoadStopTile(tile)) return GetRoadStopDir(tile); + if (IsBayRoadStopTile(tile)) return GetRoadStopDir(tile); if ((RoadTramType)subtype == RTT_TRAM) return GetSingleTramBit(tile); } diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 102efa3a83..a71d2005e7 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -2487,7 +2487,7 @@ CommandCost CmdConvertRoad(DoCommandFlag flags, TileIndex tile, TileIndex area_s } uint num_pieces = CountBits(GetAnyRoadBits(tile, rtt)); - if (tt == MP_STATION && IsStandardRoadStopTile(tile)) { + if (tt == MP_STATION && IsBayRoadStopTile(tile)) { num_pieces *= ROAD_STOP_TRACKBIT_FACTOR; } else if (tt == MP_ROAD && IsRoadDepot(tile)) { num_pieces *= ROAD_DEPOT_TRACKBIT_FACTOR; diff --git a/src/roadstop.cpp b/src/roadstop.cpp index e9f3a9a238..2e4f441973 100644 --- a/src/roadstop.cpp +++ b/src/roadstop.cpp @@ -45,7 +45,7 @@ RoadStop *RoadStop::GetNextRoadStop(const RoadVehicle *v) const /* The vehicle cannot go to this roadstop (different roadtype) */ if (!HasTileAnyRoadType(rs->xy, v->compatible_roadtypes)) continue; /* The vehicle is articulated and can therefore not go to a standard road stop. */ - if (IsStandardRoadStopTile(rs->xy) && v->HasArticulatedPart()) continue; + if (IsBayRoadStopTile(rs->xy) && v->HasArticulatedPart()) continue; /* The vehicle can actually go to this road stop. So, return it! */ return rs; @@ -215,7 +215,7 @@ void RoadStop::ClearDriveThrough() */ void RoadStop::Leave(RoadVehicle *rv) { - if (IsStandardRoadStopTile(rv->tile)) { + if (IsBayRoadStopTile(rv->tile)) { /* Vehicle is leaving a road stop tile, mark bay as free */ this->FreeBay(HasBit(rv->state, RVS_USING_SECOND_BAY)); this->SetEntranceBusy(false); @@ -232,7 +232,7 @@ void RoadStop::Leave(RoadVehicle *rv) */ bool RoadStop::Enter(RoadVehicle *rv) { - if (IsStandardRoadStopTile(this->xy)) { + if (IsBayRoadStopTile(this->xy)) { /* For normal (non drive-through) road stops * Check if station is busy or if there are no free bays or whether it is a articulated vehicle. */ if (this->IsEntranceBusy() || !this->HasFreeBay() || rv->HasArticulatedPart()) return false; diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 4917a05b50..80869d9c03 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -893,7 +893,7 @@ static Trackdir RoadFindPathToDest(RoadVehicle *v, TileIndex tile, DiagDirection /* Road depot owned by another company or with the wrong orientation */ trackdirs = TRACKDIR_BIT_NONE; } - } else if (IsTileType(tile, MP_STATION) && IsStandardRoadStopTile(tile)) { + } 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()) { @@ -908,7 +908,7 @@ static Trackdir RoadFindPathToDest(RoadVehicle *v, TileIndex tile, DiagDirection trackdirs = TRACKDIR_BIT_NONE; } else { /* Proper station type, check if there is free loading bay */ - if (!_settings_game.pf.roadveh_queue && IsStandardRoadStopTile(tile) && + if (!_settings_game.pf.roadveh_queue && IsBayRoadStopTile(tile) && !RoadStop::GetByTile(tile, rstype)->HasFreeBay()) { /* Station is full and RV queuing is off */ trackdirs = TRACKDIR_BIT_NONE; @@ -1535,7 +1535,7 @@ again: if (v->current_order.IsType(OT_LEAVESTATION)) v->current_order.Free(); } - if (IsStandardRoadStopTile(v->tile)) rs->SetEntranceBusy(true); + if (IsBayRoadStopTile(v->tile)) rs->SetEntranceBusy(true); StartRoadVehSound(v); SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); @@ -1740,7 +1740,7 @@ Trackdir RoadVehicle::GetVehicleTrackdir() const return DiagDirToDiagTrackdir(GetRoadDepotDirection(this->tile)); } - if (IsStandardRoadStopTile(this->tile)) { + if (IsBayRoadStopTile(this->tile)) { /* We'll assume the road vehicle is facing outwards */ return DiagDirToDiagTrackdir(GetRoadStopDir(this->tile)); // Road vehicle in a station } diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 1a13b011c9..bc0c7253a8 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2828,7 +2828,7 @@ bool AfterLoadGame() /* The road owner of standard road stops was not properly accounted for. */ if (IsSavegameVersionBefore(SLV_172)) { for (auto t : Map::Iterate()) { - if (!IsStandardRoadStopTile(t)) continue; + if (!IsBayRoadStopTile(t)) continue; Owner o = GetTileOwner(t); SetRoadOwner(t, RTT_ROAD, o); SetRoadOwner(t, RTT_TRAM, o); diff --git a/src/station.cpp b/src/station.cpp index 4abc2de378..1338077d57 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -211,7 +211,7 @@ RoadStop *Station::GetPrimaryRoadStop(const RoadVehicle *v) const /* The vehicle cannot go to this roadstop (different roadtype) */ if (!HasTileAnyRoadType(rs->xy, v->compatible_roadtypes)) continue; /* The vehicle is articulated and can therefore not go to a standard road stop. */ - if (IsStandardRoadStopTile(rs->xy) && v->HasArticulatedPart()) continue; + if (IsBayRoadStopTile(rs->xy) && v->HasArticulatedPart()) continue; /* The vehicle can actually go to this road stop. So, return it! */ break; diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 4a561ad060..784b4bac37 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -3408,7 +3408,7 @@ static TrackStatus GetTileTrackStatus_Station(TileIndex tile, TransportType mode Axis axis = DiagDirToAxis(dir); if (side != INVALID_DIAGDIR) { - if (axis != DiagDirToAxis(side) || (IsStandardRoadStopTile(tile) && dir != side)) break; + if (axis != DiagDirToAxis(side) || (IsBayRoadStopTile(tile) && dir != side)) break; } trackbits = AxisToTrackBits(axis); diff --git a/src/station_map.h b/src/station_map.h index ed21c71848..d1032d8ab8 100644 --- a/src/station_map.h +++ b/src/station_map.h @@ -216,11 +216,11 @@ static inline bool IsRoadStopTile(Tile t) } /** - * Is tile \a t a standard (non-drive through) road stop station? + * Is tile \a t a bay (non-drive through) road stop station? * @param t Tile to check - * @return \c true if the tile is a station tile and a standard road stop + * @return \c true if the tile is a station tile and a bay road stop */ -static inline bool IsStandardRoadStopTile(Tile t) +static inline bool IsBayRoadStopTile(Tile t) { return IsRoadStopTile(t) && GetStationGfx(t) < GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET; } diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 30463dd25d..c9e63db54d 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -847,7 +847,7 @@ void OnTick_Town() */ static RoadBits GetTownRoadBits(TileIndex tile) { - if (IsRoadDepotTile(tile) || IsStandardRoadStopTile(tile)) return ROAD_NONE; + if (IsRoadDepotTile(tile) || IsBayRoadStopTile(tile)) return ROAD_NONE; return GetAnyRoadBits(tile, RTT_ROAD, true); } diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 609c7a1a3e..7e9d9a0a13 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2896,7 +2896,7 @@ StringID GetVehicleCannotUseStationReason(const Vehicle *v, const Station *st) for (; rs != nullptr; rs = rs->next) { /* Articulated vehicles cannot use bay road stops, only drive-through. Make sure the vehicle can actually use this bay stop */ - if (HasTileAnyRoadType(rs->xy, rv->compatible_roadtypes) && IsStandardRoadStopTile(rs->xy) && rv->HasArticulatedPart()) { + if (HasTileAnyRoadType(rs->xy, rv->compatible_roadtypes) && IsBayRoadStopTile(rs->xy) && rv->HasArticulatedPart()) { err = STR_ERROR_NO_STOP_ARTICULATED_VEHICLE; continue; }