summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-11-06 12:53:31 +0000
committerterkhen <terkhen@openttd.org>2010-11-06 12:53:31 +0000
commitc8a56f17f82be7d4a8e935fc514c86a313dc7d15 (patch)
tree4a2552f26ee887aa326721881fbbe6f62b8b48d2 /src/aircraft_cmd.cpp
parent78d0a1cb1af68863e3e7bfed584f4a94ee46f611 (diff)
downloadopenttd-c8a56f17f82be7d4a8e935fc514c86a313dc7d15.tar.xz
(svn r21097) -Codechange: Unify cached max speed for all vehicle types.
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 1f9df1853..ed7196261 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -535,10 +535,10 @@ void UpdateAircraftCache(Aircraft *v)
/* Convert from original units to km-ish/h */
max_speed = (max_speed * 128) / 10;
- v->acache.cached_max_speed = max_speed;
+ v->vcache.cached_max_speed = max_speed;
} else {
/* Use the default max speed of the vehicle. */
- v->acache.cached_max_speed = v->max_speed;
+ v->vcache.cached_max_speed = v->max_speed;
}
}
@@ -570,9 +570,9 @@ static int UpdateAircraftSpeed(Aircraft *v, uint speed_limit = SPEED_LIMIT_NONE,
* and take-off speeds being too low. */
speed_limit *= _settings_game.vehicle.plane_speed;
- if (v->acache.cached_max_speed < speed_limit) {
+ if (v->vcache.cached_max_speed < speed_limit) {
if (v->cur_speed < speed_limit) hard_limit = false;
- speed_limit = v->acache.cached_max_speed;
+ speed_limit = v->vcache.cached_max_speed;
}
v->subspeed = (t = v->subspeed) + (byte)spd;
@@ -640,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->acache.cached_max_speed / 200), 90);
+ base_altitude += min(20 * (v->vcache.cached_max_speed / 200), 90);
return base_altitude;
}