diff options
author | rubidium <rubidium@openttd.org> | 2011-01-26 17:33:14 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-01-26 17:33:14 +0000 |
commit | 982de9cf86ad7d4c6bb4e77b19953999a1ee9eb6 (patch) | |
tree | fe1ce42108bd7da554dc2b78bc536d967a3ae078 /src | |
parent | 4fff63d790ab865cc93963d1939f27ee1c023ace (diff) | |
download | openttd-982de9cf86ad7d4c6bb4e77b19953999a1ee9eb6.tar.xz |
(svn r21913) -Codechange: move bridge speed limiting for road vehicles to the same (logically speaking) place as for trains
Diffstat (limited to 'src')
-rw-r--r-- | src/roadveh_cmd.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index c955fe87e..ce5d380b5 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -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) { |