From 2918fab68d1a37c0a342dfae4a2bfa350facaf8b Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 6 Feb 2007 09:29:56 +0000 Subject: (svn r8609) -Fix: a road vehicle that is very close after another (slower) road vehicle gets its speed reset to 0 when entering a tunnel, which causes a traffic jam outside of the tunnel. --- src/roadveh_cmd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index b07a81887..3edb3ca9d 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1330,8 +1330,9 @@ static void RoadVehController(Vehicle *v) GetNewVehiclePos(v, &gp); - if (RoadVehFindCloseTo(v, gp.x, gp.y, v->direction) != NULL) { - v->cur_speed = 0; + const Vehicle *u = RoadVehFindCloseTo(v, gp.x, gp.y, v->direction); + if (u != NULL && u->cur_speed < v->cur_speed) { + v->cur_speed = u->cur_speed; return; } -- cgit v1.2.3-70-g09d2