diff options
author | terkhen <terkhen@openttd.org> | 2010-12-14 21:33:53 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-12-14 21:33:53 +0000 |
commit | 48b7916458de4b2cdbc226a4a6ab078db4c77e73 (patch) | |
tree | c3a49ca7a91890042ca56765574bc40a54c15f96 /src/ground_vehicle.hpp | |
parent | a93944e765776c6e9a2bd556457cd93748068da6 (diff) | |
download | openttd-48b7916458de4b2cdbc226a4a6ab078db4c77e73.tar.xz |
(svn r21521) -Codechange: Unify some cached values that were present in both road vehicles and trains.
Diffstat (limited to 'src/ground_vehicle.hpp')
-rw-r--r-- | src/ground_vehicle.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp index 5033bef75..2922fff1d 100644 --- a/src/ground_vehicle.hpp +++ b/src/ground_vehicle.hpp @@ -36,6 +36,11 @@ struct GroundVehicleCache { uint16 cached_max_track_speed; ///< Maximum consist speed limited by track type (valid only for the first engine). uint32 cached_power; ///< Total power of the consist (valid only for the first engine). uint32 cached_air_drag; ///< Air drag coefficient of the vehicle (valid only for the first engine). + + /* Cached NewGRF values, recalculated on load and each time a vehicle is added to/removed from the consist. */ + uint16 cached_total_length; ///< Length of the whole vehicle (valid only for the first engine). + EngineID first_engine; ///< Cached EngineID of the front vehicle. INVALID_ENGINE for the front vehicle itself. + uint8 cached_veh_length; ///< Length of this vehicle in units of 1/8 of normal length. It is cached because this can be set by a callback. }; /** Ground vehicle flags. */ |