(svn r11571) -Fix [FS#1493]: road vehicle getting to the wrong side of a station when trying to overtake in there.
authorrubidium
Tue, 04 Dec 2007 21:53:09 +0000
changeset 8011 b9f348e95d25
parent 8010 362ba0e81391
child 8012 5faf4ff3b4d2
(svn r11571) -Fix [FS#1493]: road vehicle getting to the wrong side of a station when trying to overtake in there.
src/roadveh_cmd.cpp
--- a/src/roadveh_cmd.cpp	Tue Dec 04 21:39:03 2007 +0000
+++ b/src/roadveh_cmd.cpp	Tue Dec 04 21:53:09 2007 +0000
@@ -1491,13 +1491,17 @@
 	uint32 r;
 
 	if (v->u.road.overtaking != 0)  {
-		if (++v->u.road.overtaking_ctr >= 35)
+		if (IsTileType(v->tile, MP_STATION)) {
+			/* Force us to be not overtaking! */
+			v->u.road.overtaking = 0;
+		} else if (++v->u.road.overtaking_ctr >= 35) {
 			/* If overtaking just aborts at a random moment, we can have a out-of-bound problem,
 			 *  if the vehicle started a corner. To protect that, only allow an abort of
 			 *  overtake if we are on straight roads */
 			if (v->u.road.state < RVSB_IN_ROAD_STOP && IsStraightRoadTrackdir((Trackdir)v->u.road.state)) {
 				v->u.road.overtaking = 0;
 			}
+		}
 	}
 
 	/* If this vehicle is in a depot and we've reached this point it must be