From 77c14c2f1e4fdcc6fb738ef36cba63dc64c0c9fd Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 27 Oct 2020 23:35:32 +0000 Subject: [PATCH] Relax constraints on tile behind overtaking vehicle --- src/roadveh_cmd.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index cd40ca156b..ed1a702dab 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1010,8 +1010,13 @@ static void RoadVehCheckOvertake(RoadVehicle *v, RoadVehicle *u) check_tile = v->tile - check_tile_diff; for (; tile_count != 0; tile_count--, check_tile -= check_tile_diff) { od.tile = check_tile; - if (CheckRoadInfraUnsuitableForOvertaking(&od)) return; - if (CheckRoadBlockedForOvertaking(&od)) return; + if (tile_count == 1) { + RoadBits rb = GetAnyRoadBits(check_tile, RTT_ROAD); + if ((rb & DiagDirToRoadBits(dir)) && HasVehicleOnPos(check_tile, VEH_ROAD, &od, EnumFindVehBlockingOvertakeBehind)) return; + } else { + if (CheckRoadInfraUnsuitableForOvertaking(&od)) return; + if (CheckRoadBlockedForOvertaking(&od)) return; + } } /* When the vehicle in front of us is stopped we may only take