diff options
author | rubidium <rubidium@openttd.org> | 2009-05-23 09:10:56 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-05-23 09:10:56 +0000 |
commit | 6237fe146228e84761c6aba14bf7acf6c359f061 (patch) | |
tree | 0ff89de7f14a652d59d972e949761819642296a4 /src/aircraft.h | |
parent | da5661a0c8870c532c393ec3d330c3fbb44eb8ac (diff) | |
download | openttd-6237fe146228e84761c6aba14bf7acf6c359f061.tar.xz |
(svn r16394) -Codechange: move (NewGRF) cache variables into a separate struct so (some vehicle related) NewGRF cache 'desyncs' can be tested easier.
Diffstat (limited to 'src/aircraft.h')
-rw-r--r-- | src/aircraft.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/aircraft.h b/src/aircraft.h index d4e11f206..24f4659f0 100644 --- a/src/aircraft.h +++ b/src/aircraft.h @@ -83,6 +83,11 @@ 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. +}; + /** * This class 'wraps' Vehicle; you do not actually instantiate this class. * You create a Vehicle using AllocateVehicle, so it is added to the pool @@ -92,8 +97,9 @@ byte GetAircraftFlyingAltitude(const Aircraft *v); * As side-effect the vehicle type is set correctly. */ struct Aircraft : public Vehicle { + AircraftCache acache; ///< Cache of often used calculated values + uint16 crashed_counter; - uint16 cached_max_speed; byte pos; byte previous_pos; StationID targetairport; |