(svn r11477) -Fix [FS#1451]: a road vehicle must not show that it is driving max speed when it is standing still waiting for the vehicle in from of it.
authorrubidium
Mon, 19 Nov 2007 18:58:32 +0000
changeset 8420 e90a0306973f
parent 8419 de9999f762d0
child 8421 9cd504b58efb
(svn r11477) -Fix [FS#1451]: a road vehicle must not show that it is driving max speed when it is standing still waiting for the vehicle in from of it.
src/roadveh_cmd.cpp
--- a/src/roadveh_cmd.cpp	Mon Nov 19 18:58:04 2007 +0000
+++ b/src/roadveh_cmd.cpp	Mon Nov 19 18:58:32 2007 +0000
@@ -1624,7 +1624,13 @@
 		y = TileY(tile) * TILE_SIZE + rdp[start_frame].y;
 
 		newdir = RoadVehGetSlidingDirection(v, x, y);
-		if (IsRoadVehFront(v) && RoadVehFindCloseTo(v, x, y, newdir) != NULL) return false;
+		if (IsRoadVehFront(v)) {
+			Vehicle *u = RoadVehFindCloseTo(v, x, y, newdir);
+			if (u != NULL) {
+				v->cur_speed = u->First()->cur_speed;
+				return false;
+			}
+		}
 
 		r = VehicleEnterTile(v, tile, x, y);
 		if (HASBIT(r, VETS_CANNOT_ENTER)) {