Change: Extend entity override manager and station spec lists to support 16 bit IDs.
This commit is contained in:
@@ -20,8 +20,10 @@
|
||||
/** Save and load the mapping between a spec and the NewGRF it came from. */
|
||||
static const SaveLoad _newgrf_mapping_desc[] = {
|
||||
SLE_VAR(EntityIDMapping, grfid, SLE_UINT32),
|
||||
SLE_VAR(EntityIDMapping, entity_id, SLE_UINT8),
|
||||
SLE_VAR(EntityIDMapping, substitute_id, SLE_UINT8),
|
||||
SLE_CONDVAR(EntityIDMapping, entity_id, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_EXTEND_ENTITY_MAPPING),
|
||||
SLE_CONDVAR(EntityIDMapping, entity_id, SLE_UINT16, SLV_EXTEND_ENTITY_MAPPING, SL_MAX_VERSION),
|
||||
SLE_CONDVAR(EntityIDMapping, substitute_id, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_EXTEND_ENTITY_MAPPING),
|
||||
SLE_CONDVAR(EntityIDMapping, substitute_id, SLE_UINT16, SLV_EXTEND_ENTITY_MAPPING, SL_MAX_VERSION),
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -354,6 +354,7 @@ enum SaveLoadVersion : uint16 {
|
||||
SLV_AI_START_DATE, ///< 309 PR#10653 Removal of individual AI start dates and added a generic one.
|
||||
|
||||
SLV_EXTEND_VEHICLE_RANDOM, ///< 310 PR#10701 Extend vehicle random bits.
|
||||
SLV_EXTEND_ENTITY_MAPPING, ///< 311 PR#10672 Extend entity mapping range.
|
||||
|
||||
SL_MAX_VERSION, ///< Highest possible saveload version
|
||||
};
|
||||
|
||||
@@ -205,8 +205,9 @@ static void SwapPackets(GoodsEntry *ge)
|
||||
class SlStationSpecList : public DefaultSaveLoadHandler<SlStationSpecList, BaseStation> {
|
||||
public:
|
||||
inline static const SaveLoad description[] = {
|
||||
SLE_CONDVAR(StationSpecList, grfid, SLE_UINT32, SLV_27, SL_MAX_VERSION),
|
||||
SLE_CONDVAR(StationSpecList, localidx, SLE_UINT8, SLV_27, SL_MAX_VERSION),
|
||||
SLE_CONDVAR(StationSpecList, grfid, SLE_UINT32, SLV_27, SL_MAX_VERSION),
|
||||
SLE_CONDVAR(StationSpecList, localidx, SLE_FILE_U8 | SLE_VAR_U16, SLV_27, SLV_EXTEND_ENTITY_MAPPING),
|
||||
SLE_CONDVAR(StationSpecList, localidx, SLE_UINT16, SLV_EXTEND_ENTITY_MAPPING, SL_MAX_VERSION),
|
||||
};
|
||||
inline const static SaveLoadCompatTable compat_description = _station_spec_list_sl_compat;
|
||||
|
||||
@@ -236,8 +237,9 @@ uint8 SlStationSpecList::last_num_specs;
|
||||
class SlRoadStopSpecList : public DefaultSaveLoadHandler<SlRoadStopSpecList, BaseStation> {
|
||||
public:
|
||||
inline static const SaveLoad description[] = {
|
||||
SLE_VAR(RoadStopSpecList, grfid, SLE_UINT32),
|
||||
SLE_VAR(RoadStopSpecList, localidx, SLE_UINT8),
|
||||
SLE_VAR(RoadStopSpecList, grfid, SLE_UINT32),
|
||||
SLE_CONDVAR(RoadStopSpecList, localidx, SLE_FILE_U8 | SLE_VAR_U16, SLV_27, SLV_EXTEND_ENTITY_MAPPING),
|
||||
SLE_CONDVAR(RoadStopSpecList, localidx, SLE_UINT16, SLV_EXTEND_ENTITY_MAPPING, SL_MAX_VERSION),
|
||||
};
|
||||
inline const static SaveLoadCompatTable compat_description = _station_road_stop_spec_list_sl_compat;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user