Mercurial > hg > openttd
changeset 17174:8e48438edd69 draft
(svn r21913) -Codechange: move bridge speed limiting for road vehicles to the same (logically speaking) place as for trains
author | rubidium <rubidium@openttd.org> |
---|---|
date | Wed, 26 Jan 2011 17:33:14 +0000 |
parents | 587b92c2457c |
children | b21a59ab8453 |
files | src/roadveh_cmd.cpp |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -666,12 +666,6 @@ 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 @@ /* 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) {