# HG changeset patch # User frosch # Date 2015-03-16 20:01:14 # Node ID 7dfdb58be409ed094f1dee5e7fc3e25a7451feb8 # Parent 23e8e5f9fc887b47befa1ace4a499d3f90088bbc (svn r27190) -Fix [FS#6255] (r27106): Original road vehicle acceleration crashed for vehicles taking over. diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -824,8 +824,9 @@ static void RoadVehCheckOvertake(RoadVeh if (v->state >= RVSB_IN_ROAD_STOP || !IsStraightRoadTrackdir((Trackdir)(v->state & RVSB_TRACKDIR_MASK))) return; /* Can't overtake a vehicle that is moving faster than us. If the vehicle in front is - * accelerating, take the maximum speed for the comparison, else the current speed. */ - int u_speed = u->GetAcceleration() > 0 ? u->GetCurrentMaxSpeed() : u->cur_speed; + * accelerating, take the maximum speed for the comparison, else the current speed. + * Original acceleration always accelerates, so always use the maximum speed. */ + int u_speed = (_settings_game.vehicle.roadveh_acceleration_model == AM_ORIGINAL || u->GetAcceleration() > 0) ? u->GetCurrentMaxSpeed() : u->cur_speed; if (u_speed >= v->GetCurrentMaxSpeed() && !(u->vehstatus & VS_STOPPED) && u->cur_speed != 0) {