From 4e4720f2178c9e0faf7233e55bec71e6ae19f9ad Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 6 Jun 2021 16:03:56 +0200 Subject: 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. --- src/order_base.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/order_base.h') diff --git a/src/order_base.h b/src/order_base.h index c510bd3e0..84f5289ec 100644 --- a/src/order_base.h +++ b/src/order_base.h @@ -32,9 +32,11 @@ extern OrderListPool _orderlist_pool; */ struct Order : OrderPool::PoolItem<&_order_pool> { private: - friend SaveLoadTable GetVehicleDescription(VehicleType vt); ///< Saving and loading the current order of vehicles. friend void Load_VEHS(); ///< Loading of ancient vehicles. friend SaveLoadTable GetOrderDescription(); ///< Saving and loading of orders. + /* So we can use private/protected variables in the saveload code */ + friend class SlVehicleCommon; + friend class SlVehicleDisaster; uint8 type; ///< The type of order + non-stop flags uint8 flags; ///< Load/unload types, depot order/action types. -- cgit v1.2.3-54-g00ecf