(svn r21913) -Codechange: move bridge speed limiting for road vehicles to the same (logically speaking) place as for trains

This commit is contained in:
rubidium 2011-01-26 17:33:14 +00:00
parent 4fff63d790
commit 982de9cf86
1 changed files with 6 additions and 6 deletions

View File

@ -666,12 +666,6 @@ static int RoadVehAccelerate(RoadVehicle *v)
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 IndividualRoadVehicleController(RoadVehicle *v, const RoadVehicle *p
/* 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) {