Changeset - r17164:8831785ebfb3
[Not reviewed]
master
0 1 0
rubidium - 13 years ago 2011-01-26 17:33:14
rubidium@openttd.org
(svn r21913) -Codechange: move bridge speed limiting for road vehicles to the same (logically speaking) place as for trains
1 file changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/roadveh_cmd.cpp
Show inline comments
 
@@ -666,12 +666,6 @@ static int RoadVehAccelerate(RoadVehicle
 
	int min_speed = (_settings_game.vehicle.roadveh_acceleration_model == AM_ORIGINAL) ? 0 : 4;
 
	v->cur_speed = spd = Clamp(v->cur_speed + ((int)spd >> 8), min_speed, tempmax);
 

	
 
	/* Apply bridge speed limit */
 
	if (v->state == RVSB_WORMHOLE && !(v->vehstatus & VS_HIDDEN)) {
 
		RoadVehicle *first = v->First();
 
		first->cur_speed = min(first->cur_speed, GetBridgeSpec(GetBridgeType(v->tile))->speed * 2);
 
	}
 

	
 
	int scaled_spd = v->GetAdvanceSpeed(spd);
 

	
 
	scaled_spd += v->progress;
 
@@ -1071,6 +1065,12 @@ static bool IndividualRoadVehicleControl
 
		/* Vehicle is entering a depot or is on a bridge or in a tunnel */
 
		GetNewVehiclePosResult gp = GetNewVehiclePos(v);
 

	
 
		/* Apply bridge speed limit */
 
		if (!(v->vehstatus & VS_HIDDEN)) {
 
			RoadVehicle *first = v->First();
 
			first->cur_speed = min(first->cur_speed, GetBridgeSpec(GetBridgeType(v->tile))->speed * 2);
 
		}
 

	
 
		if (v->IsFrontEngine()) {
 
			const Vehicle *u = RoadVehFindCloseTo(v, gp.x, gp.y, v->direction);
 
			if (u != NULL) {
0 comments (0 inline, 0 general)