53 if (item.value.from == item.value.to) item.value.replace_when_old =
true;
63extern const ChunkHandlerTable _autoreplace_chunk_handlers(autoreplace_chunk_handlers);
OldEngineRenewPool _old_engine_renew_saveload_pool
Temporary storage for conversion from old engine renew pool.
Loading for autoreplace chunks before table headers were added.
const SaveLoadCompat _engine_renew_sl_compat[]
Original field order for _engine_renew_desc.
Types related to autoreplacing.
static constexpr GroupID DEFAULT_GROUP
Ungrouped vehicles are in this group.
static constexpr GroupID ALL_GROUP
All vehicles are in this group.
A number of safeguards to prevent using unsafe methods.
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
Functions/types related to saving and loading games.
#define SLE_OBJECT_ADDRESS(base, variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a base c...
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
bool IsSavegameVersionBefore(SaveLoadVersion major, uint8_t minor=0)
Checks whether the savegame is below major.
@ MoreCargoPackets
Saveload version: 69, SVN revision: 10319 Allow more than ~65k cargo packets.
@ UngroupedVehicles
Saveload version: 71, SVN revision: 10567 Add a group with vehicles that aren't in any other group.
@ VehicleGroups
Saveload version: 60, SVN revision: 9874 Arbitrary grouping, by the player, of vehicles.
@ AutoreplaceWhenOldTreeLimit
Saveload version: 175, SVN revision: 24136 Autoreplace vehicle only when they are old,...
@ MinVersion
First savegame version.
@ ReadOnly
Chunk is never saved.
Declaration of functions used in more save/load files.
OldSaveLoadPool< OldEngineRenew > OldEngineRenewPool
Type for conversion of old engine renew pool.
Definition of base types and functions in a cross-platform compatible way.
ChunkHandler(ChunkId id, ChunkType type)
Create this ChunkHandler.
void Load() const override
Load the chunk.
static const SaveLoad description[]
Saveload description for handler.
static SaveLoad Variable(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of a variable in some savegame versions.