From c8a56f17f82be7d4a8e935fc514c86a313dc7d15 Mon Sep 17 00:00:00 2001 From: terkhen Date: Sat, 6 Nov 2010 12:53:31 +0000 Subject: (svn r21097) -Codechange: Unify cached max speed for all vehicle types. --- src/aircraft.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/aircraft.h') 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 { - 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 { 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(); -- cgit v1.2.3-54-g00ecf