From b74de5ff2b23f3925ce5ba64259738fa2bcb84e9 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 29 Jan 2022 12:33:12 +0000 Subject: [PATCH] Fix crash in road vehicle overtaking checks with road waypoints --- src/roadveh_cmd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 59efd300d7..e1630f6330 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1083,7 +1083,7 @@ static void RoadVehCheckOvertake(RoadVehicle *v, RoadVehicle *u) check_tile = ahead_end; continue; } - if (IsDriveThroughStopTile(check_tile) && GetDriveThroughStopDisallowedRoadDirections(check_tile) != DRD_NONE) { + if (IsStationRoadStopTile(check_tile) && IsDriveThroughStopTile(check_tile) && GetDriveThroughStopDisallowedRoadDirections(check_tile) != DRD_NONE) { const RoadStop *rs = RoadStop::GetByTile(check_tile, GetRoadStopType(check_tile)); DiagDirection dir = DirToDiagDir(v->direction); const RoadStop::Entry *entry = rs->GetEntry(dir); @@ -1799,7 +1799,7 @@ again: * stop. It also makes it possible to load when on the edge of * two road stops; otherwise you could get vehicles that should * be loading but are not actually loading. */ - if (IsDriveThroughStopTile(v->tile) && + if (IsStationRoadStopTile(v->tile) && IsDriveThroughStopTile(v->tile) && RoadStop::IsDriveThroughRoadStopContinuation(v->tile, tile) && v->tile != tile) { /* So, keep 'our' state */