diff options
author | terkhen <terkhen@openttd.org> | 2010-11-06 12:50:34 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-11-06 12:50:34 +0000 |
commit | 78d0a1cb1af68863e3e7bfed584f4a94ee46f611 (patch) | |
tree | 3919b2ecde621dc86ccf82c7f64e564ecd7db520 /src/aircraft_cmd.cpp | |
parent | cfac2ced69f072a3881e990837f82a884e27cd40 (diff) | |
download | openttd-78d0a1cb1af68863e3e7bfed584f4a94ee46f611.tar.xz |
(svn r21096) -Fix: Display the real max speed for aircrafts instead of always using the engine value.
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 7f389c6e3..1f9df1853 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -537,7 +537,8 @@ void UpdateAircraftCache(Aircraft *v) v->acache.cached_max_speed = max_speed; } else { - v->acache.cached_max_speed = 0xFFFF; + /* Use the default max speed of the vehicle. */ + v->acache.cached_max_speed = v->max_speed; } } @@ -639,7 +640,7 @@ byte GetAircraftFlyingAltitude(const Aircraft *v) } /* Make faster planes fly higher so that they can overtake slower ones */ - base_altitude += min(20 * (v->max_speed / 200), 90); + base_altitude += min(20 * (v->acache.cached_max_speed / 200), 90); return base_altitude; } |