1
0
Fork 0

(svn r11367) -Fix [FS#1258]: non-articulated road vehicles should be able to overtake (not-too-long) articulated vehicles, i.e. overtaking of articulated vehicles that are several (3+) tiles long is not supported.

release/0.6
rubidium 2007-10-31 22:15:19 +00:00
parent 3a7c8cc88d
commit 6fe325ae7f
1 changed files with 4 additions and 3 deletions

View File

@ -1015,7 +1015,7 @@ static void* EnumFindVehToOvertake(Vehicle* v, void* data)
const OvertakeData* od = (OvertakeData*)data; const OvertakeData* od = (OvertakeData*)data;
return return
v->tile == od->tile && v->type == VEH_ROAD && v != od->u && v != od->v ? v->tile == od->tile && v->type == VEH_ROAD && v->First() == v && v != od->u && v != od->v ?
v : NULL; v : NULL;
} }
@ -1465,8 +1465,8 @@ static bool IndividualRoadVehicleController(Vehicle *v, const Vehicle *prev)
GetNewVehiclePosResult gp = GetNewVehiclePos(v); GetNewVehiclePosResult gp = GetNewVehiclePos(v);
const Vehicle *u = RoadVehFindCloseTo(v, gp.x, gp.y, v->direction); const Vehicle *u = RoadVehFindCloseTo(v, gp.x, gp.y, v->direction);
if (u != NULL && u->cur_speed < v->cur_speed) { if (u != NULL && u->First()->cur_speed < v->cur_speed) {
v->cur_speed = u->cur_speed; v->cur_speed = u->First()->cur_speed;
return false; return false;
} }
@ -1663,6 +1663,7 @@ again:
Vehicle* u = RoadVehFindCloseTo(v, x, y, new_dir); Vehicle* u = RoadVehFindCloseTo(v, x, y, new_dir);
if (u != NULL) { if (u != NULL) {
u = u->First();
/* There is a vehicle in front overtake it if possible */ /* There is a vehicle in front overtake it if possible */
if (v->u.road.overtaking == 0) RoadVehCheckOvertake(v, u); if (v->u.road.overtaking == 0) RoadVehCheckOvertake(v, u);
if (v->u.road.overtaking == 0) v->cur_speed = u->cur_speed; if (v->u.road.overtaking == 0) v->cur_speed = u->cur_speed;