|
@@ -2403,15 +2403,15 @@ static const byte _enter_station_speedta
|
|
|
215, 195, 175, 155, 135, 115, 95, 75, 55, 35, 15, 0
|
|
|
};
|
|
|
|
|
|
static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y)
|
|
|
{
|
|
|
StationID station_id = GetStationIndex(tile);
|
|
|
if (!v->current_order.ShouldStopAtStation(v, station_id)) return VETSB_CONTINUE;
|
|
|
|
|
|
if (v->type == VEH_TRAIN) {
|
|
|
if (!v->current_order.ShouldStopAtStation(v, station_id)) return VETSB_CONTINUE;
|
|
|
if (IsRailwayStation(tile) && IsFrontEngine(v) &&
|
|
|
!IsCompatibleTrainStationTile(tile + TileOffsByDiagDir(DirToDiagDir(v->direction)), tile)) {
|
|
|
DiagDirection dir = DirToDiagDir(v->direction);
|
|
|
|
|
|
x &= 0xF;
|
|
|
y &= 0xF;
|
|
@@ -2433,12 +2433,14 @@ static VehicleEnterTileStatus VehicleEnt
|
|
|
if (v->u.road.state < RVSB_IN_ROAD_STOP && !IsReversingRoadTrackdir((Trackdir)v->u.road.state) && v->u.road.frame == 0) {
|
|
|
if (IsRoadStop(tile) && IsRoadVehFront(v)) {
|
|
|
/* Attempt to allocate a parking bay in a road stop */
|
|
|
RoadStop *rs = GetRoadStopByTile(tile, GetRoadStopType(tile));
|
|
|
|
|
|
if (IsDriveThroughStopTile(tile)) {
|
|
|
if (!v->current_order.ShouldStopAtStation(v, station_id)) return VETSB_CONTINUE;
|
|
|
|
|
|
/* Vehicles entering a drive-through stop from the 'normal' side use first bay (bay 0). */
|
|
|
byte side = ((DirToDiagDir(v->direction) == ReverseDiagDir(GetRoadStopDir(tile))) == (v->u.road.overtaking == 0)) ? 0 : 1;
|
|
|
|
|
|
if (!rs->IsFreeBay(side)) return VETSB_CANNOT_ENTER;
|
|
|
|
|
|
/* Check if the vehicle is stopping at this road stop */
|