summaryrefslogtreecommitdiff
path: root/src/ground_vehicle.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2010-11-07 13:35:12 +0000
committermichi_cc <michi_cc@openttd.org>2010-11-07 13:35:12 +0000
commitb26b8b5b2abbeb29bc7dffb71198405c742b1aee (patch)
treeeca88fa3a589c20246031bf51049ed2081d9c836 /src/ground_vehicle.cpp
parent2d801c64a1d8ce0cf3f4f106d77c47fea33bbd4d (diff)
downloadopenttd-b26b8b5b2abbeb29bc7dffb71198405c742b1aee.tar.xz
(svn r21107) -Fix: Don't use the maximum track speed where the maximum vehicle speed is meant.
Diffstat (limited to 'src/ground_vehicle.cpp')
-rw-r--r--src/ground_vehicle.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ground_vehicle.cpp b/src/ground_vehicle.cpp
index 66e5b9933..142353f7e 100644
--- a/src/ground_vehicle.cpp
+++ b/src/ground_vehicle.cpp
@@ -47,8 +47,9 @@ void GroundVehicle<T, Type>::PowerChanged()
/* If air drag is set to zero (default), the resulting air drag coefficient is dependent on max speed. */
if (air_drag_value == 0) {
+ uint16 max_speed = v->GetDisplayMaxSpeed();
/* Simplification of the method used in TTDPatch. It uses <= 10 to change more steadily from 128 to 196. */
- air_drag = (max_track_speed <= 10) ? 192 : max(2048 / max_track_speed, 1);
+ air_drag = (max_speed <= 10) ? 192 : max(2048 / max_speed, 1);
} else {
/* According to the specs, a value of 0x01 in the air drag property means "no air drag". */
air_drag = (air_drag_value == 1) ? 0 : air_drag_value;