Changeset - r6692:6f753e42b5f0
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2007-05-25 22:31:34
rubidium@openttd.org
(svn r9924) -Fix: update the road vehicle speeds when stopped and/or running just behind another vehicle.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/roadveh_cmd.cpp
Show inline comments
 
@@ -258,12 +258,13 @@ int32 CmdStartStopRoadVeh(TileIndex tile
 
	if (flags & DC_EXEC) {
 
		if (IsRoadVehInDepotStopped(v)) {
 
			DeleteVehicleNews(p1, STR_9016_ROAD_VEHICLE_IS_WAITING);
 
		}
 

	
 
		v->vehstatus ^= VS_STOPPED;
 
		v->cur_speed = 0;
 
		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
 
		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 
	}
 

	
 
	return 0;
 
}
 
@@ -1516,12 +1517,13 @@ again:
 
	if (!IS_BYTE_INSIDE(v->u.road.state, RVSB_IN_ROAD_STOP, RVSB_IN_ROAD_STOP_END)) {
 
		/* Vehicle is not in a road stop.
 
		 * Check for another vehicle to overtake */
 
		Vehicle* u = RoadVehFindCloseTo(v, x, y, new_dir);
 

	
 
		if (u != NULL) {
 
			v->cur_speed = u->cur_speed;
 
			/* There is a vehicle in front overtake it if possible */
 
			if (v->u.road.overtaking == 0) RoadVehCheckOvertake(v, u);
 
			return;
 
		}
 
	}
 

	
0 comments (0 inline, 0 general)