Changeset - r8266:180a5b87f5f3
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2008-01-13 12:08:35
rubidium@openttd.org
(svn r11830) -Fix [FS#1625]: road vehicles would not wait in line, but at a single point on bridges. Based on a patch by SmatZ.
1 file changed with 7 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/roadveh_cmd.cpp
Show inline comments
 
@@ -895,6 +895,7 @@ static Vehicle* RoadVehFindCloseTo(Vehic
 
	rvf.veh = v;
 
	if (front->u.road.state == RVSB_WORMHOLE) {
 
		u = (Vehicle*)VehicleFromPos(v->tile, &rvf, EnumCheckRoadVehClose);
 
		if (u == NULL) u = (Vehicle*)VehicleFromPos(GetOtherTunnelBridgeEnd(v->tile), &rvf, EnumCheckRoadVehClose);
 
	} else {
 
		u = (Vehicle*)VehicleFromPosXY(x, y, &rvf, EnumCheckRoadVehClose);
 
	}
 
@@ -1511,10 +1512,12 @@ static bool IndividualRoadVehicleControl
 
		/* Vehicle is entering a depot or is on a bridge or in a tunnel */
 
		GetNewVehiclePosResult gp = GetNewVehiclePos(v);
 

	
 
		const Vehicle *u = RoadVehFindCloseTo(v, gp.x, gp.y, v->direction);
 
		if (u != NULL && u->First()->cur_speed < v->cur_speed) {
 
			v->cur_speed = u->First()->cur_speed;
 
			return false;
 
		if (IsRoadVehFront(v)) {
 
			const Vehicle *u = RoadVehFindCloseTo(v, gp.x, gp.y, v->direction);
 
			if (u != NULL) {
 
				v->cur_speed = u->First()->cur_speed;
 
				return false;
 
			}
 
		}
 

	
 
		if ((IsTunnelTile(gp.new_tile) || IsBridgeTile(gp.new_tile)) && HasBit(VehicleEnterTile(v, gp.new_tile, gp.x, gp.y), VETS_ENTERED_WORMHOLE)) {
0 comments (0 inline, 0 general)