diff options
author | Patric Stout <truebrain@openttd.org> | 2021-06-06 16:03:56 +0200 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-06-14 21:58:05 +0200 |
commit | 4e4720f2178c9e0faf7233e55bec71e6ae19f9ad (patch) | |
tree | af474483110fca7fd7c617e052d1d381991e1179 /src/vehicle_base.h | |
parent | 4600d289b5d12389137d36e57bfda09c26ed6caf (diff) | |
download | openttd-4e4720f2178c9e0faf7233e55bec71e6ae19f9ad.tar.xz |
Codechange: remove the special station/vehicle code from SaveLoad
With the new SLEG_STRUCT it is much easier to embed a struct
in a struct, where the sub-struct has limitations on when it is
being used.
This makes both the code easier to read (less magic) and avoids
the SaveLoad needing to know all these things about Stations
and Vehicles.
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r-- | src/vehicle_base.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 029ddcf66..a5549b444 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -200,7 +200,6 @@ extern VehiclePool _vehicle_pool; /* Some declarations of functions, so we can make them friendly */ struct GroundVehicleCache; -extern SaveLoadTable GetVehicleDescription(VehicleType vt); struct LoadgameState; extern bool LoadOldVehicle(LoadgameState *ls, int num); extern void FixOldVehicles(); @@ -232,10 +231,13 @@ private: Vehicle *previous_shared; ///< NOSAVE: pointer to the previous vehicle in the shared order chain public: - friend SaveLoadTable GetVehicleDescription(VehicleType vt); ///< So we can use private/protected variables in the saveload code friend void FixOldVehicles(); friend void AfterLoadVehicles(bool part_of_load); ///< So we can set the #previous and #first pointers while loading friend bool LoadOldVehicle(LoadgameState *ls, int num); ///< So we can set the proper next pointer while loading + /* So we can use private/protected variables in the saveload code */ + friend class SlVehicleCommon; + friend class SlVehicleDisaster; + friend void Ptrs_VEHS(); TileIndex tile; ///< Current tile index |