mirror of https://github.com/OpenTTD/OpenTTD.git
(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.
This commit is contained in:
parent
8c3793a088
commit
2918fab68d
|
@ -1330,8 +1330,9 @@ static void RoadVehController(Vehicle *v)
|
||||||
|
|
||||||
GetNewVehiclePos(v, &gp);
|
GetNewVehiclePos(v, &gp);
|
||||||
|
|
||||||
if (RoadVehFindCloseTo(v, gp.x, gp.y, v->direction) != NULL) {
|
const Vehicle *u = RoadVehFindCloseTo(v, gp.x, gp.y, v->direction);
|
||||||
v->cur_speed = 0;
|
if (u != NULL && u->cur_speed < v->cur_speed) {
|
||||||
|
v->cur_speed = u->cur_speed;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue