summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-03-16 20:01:14 +0000
committerfrosch <frosch@openttd.org>2015-03-16 20:01:14 +0000
commit59d41a89c452d5cab3714c5acf87926599a3e81c (patch)
tree9167d2eb228cf77287749dd722c06df278ba4491 /src/roadveh_cmd.cpp
parent83b2ea0eaf5eff281558d24d1167c22c68f4aaa3 (diff)
downloadopenttd-59d41a89c452d5cab3714c5acf87926599a3e81c.tar.xz
(svn r27190) -Fix [FS#6255] (r27106): Original road vehicle acceleration crashed for vehicles taking over.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 39a406a17..35c671d35 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -824,8 +824,9 @@ static void RoadVehCheckOvertake(RoadVehicle *v, RoadVehicle *u)
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) {