summaryrefslogtreecommitdiff
path: root/src/vehicle_base.h
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-05-31 22:26:44 +0200
committerGitHub <noreply@github.com>2021-05-31 22:26:44 +0200
commit9fff00ba205260ee5e11b50f87a3edee9b7e76a3 (patch)
tree2c6ee1eb6f0df2539c9ed17a2ae05541518a7dc9 /src/vehicle_base.h
parent956d761e3ef1968c6470a9e78597c5531ed7c332 (diff)
downloadopenttd-9fff00ba205260ee5e11b50f87a3edee9b7e76a3.tar.xz
Codechange: C++-ify lists for SaveLoad (#9323)
Basically, this changes "SaveLoad *" to either: 1) "SaveLoadTable" if a list of SaveLoads was meant 2) "SaveLoad &" if a single entry was meant As added bonus, this removes SL_END / SLE_END / SLEG_END. This also adds core/span.hpp, a "std::span"-lite.
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r--src/vehicle_base.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h
index f80faf1e3..029ddcf66 100644
--- a/src/vehicle_base.h
+++ b/src/vehicle_base.h
@@ -22,6 +22,7 @@
#include "group_type.h"
#include "base_consist.h"
#include "network/network.h"
+#include "saveload/saveload.h"
#include <list>
#include <map>
@@ -198,9 +199,8 @@ typedef Pool<Vehicle, VehicleID, 512, 0xFF000> VehiclePool;
extern VehiclePool _vehicle_pool;
/* Some declarations of functions, so we can make them friendly */
-struct SaveLoad;
struct GroundVehicleCache;
-extern const SaveLoad *GetVehicleDescription(VehicleType vt);
+extern SaveLoadTable GetVehicleDescription(VehicleType vt);
struct LoadgameState;
extern bool LoadOldVehicle(LoadgameState *ls, int num);
extern void FixOldVehicles();
@@ -232,7 +232,7 @@ private:
Vehicle *previous_shared; ///< NOSAVE: pointer to the previous vehicle in the shared order chain
public:
- friend const SaveLoad *GetVehicleDescription(VehicleType vt); ///< So we can use private/protected variables in the saveload code
+ 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