summaryrefslogtreecommitdiff
path: root/src/aircraft.h
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.h
parent78d0a1cb1af68863e3e7bfed584f4a94ee46f611 (diff)
downloadopenttd-c8a56f17f82be7d4a8e935fc514c86a313dc7d15.tar.xz
(svn r21097) -Codechange: Unify cached max speed for all vehicle types.
Diffstat (limited to 'src/aircraft.h')
-rw-r--r--src/aircraft.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/aircraft.h b/src/aircraft.h
index 34e6e2082..6afe4ef61 100644
--- a/src/aircraft.h
+++ b/src/aircraft.h
@@ -58,17 +58,10 @@ void AircraftNextAirportPos_and_Order(Aircraft *v);
void SetAircraftPosition(Aircraft *v, int x, int y, int z);
byte GetAircraftFlyingAltitude(const Aircraft *v);
-/** Cached oftenly queried (NewGRF) values */
-struct AircraftCache {
- uint16 cached_max_speed; ///< Cached maximum speed of the aircraft.
-};
-
/**
* Aircraft, helicopters, rotors and their shadows belong to this class.
*/
struct Aircraft : public SpecializedVehicle<Aircraft, VEH_AIRCRAFT> {
- AircraftCache acache; ///< Cache of often used calculated values
-
uint16 crashed_counter; ///< Timer for handling crash animations.
byte pos; ///< Next desired position of the aircraft.
byte previous_pos; ///< Previous desired position of the aircraft.
@@ -90,8 +83,8 @@ struct Aircraft : public SpecializedVehicle<Aircraft, VEH_AIRCRAFT> {
bool IsPrimaryVehicle() const { return this->IsNormalAircraft(); }
SpriteID GetImage(Direction direction) const;
int GetDisplaySpeed() const { return this->cur_speed; }
- int GetDisplayMaxSpeed() const { return this->acache.cached_max_speed; }
- int GetSpeedOldUnits() const { return this->acache.cached_max_speed * 10 / 128; }
+ int GetDisplayMaxSpeed() const { return this->vcache.cached_max_speed; }
+ int GetSpeedOldUnits() const { return this->vcache.cached_max_speed * 10 / 128; }
Money GetRunningCost() const;
bool IsInDepot() const { return (this->vehstatus & VS_HIDDEN) != 0 && IsHangarTile(this->tile); }
bool Tick();