Merge remote-tracking branch 'upstream/master'

This commit is contained in:
dP
2024-02-07 15:20:07 +05:30
176 changed files with 3476 additions and 2711 deletions
+2
View File
@@ -1479,6 +1479,8 @@ bool AfterLoadGame()
if (IsSavegameVersionBefore(SLV_31)) {
TimerGameCalendar::date += CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR;
TimerGameCalendar::year += CalendarTime::ORIGINAL_BASE_YEAR;
TimerGameEconomy::date += EconomyTime::DAYS_TILL_ORIGINAL_BASE_YEAR;
TimerGameEconomy::year += EconomyTime::ORIGINAL_BASE_YEAR;
for (Station *st : Station::Iterate()) st->build_date += CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR;
for (Waypoint *wp : Waypoint::Iterate()) wp->build_date += CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR;
+11 -10
View File
@@ -590,14 +590,15 @@ static const OldChunks town_chunk[] = {
OCL_SVAR( OC_FILE_U8 | OC_VAR_U16, Town, time_until_rebuild ),
OCL_SVAR( OC_FILE_U8 | OC_VAR_U16, Town, growth_rate ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[CT_PASSENGERS].new_max ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[CT_MAIL].new_max ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[CT_PASSENGERS].new_act ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[CT_MAIL].new_act ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[CT_PASSENGERS].old_max ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[CT_MAIL].old_max ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[CT_PASSENGERS].old_act ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[CT_MAIL].old_act ),
/* Slots 0 and 2 are passengers and mail respectively for old saves. */
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[0].new_max ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[2].new_max ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[0].new_act ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[2].new_act ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[0].old_max ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[2].old_max ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[0].old_act ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Town, supplied[2].old_act ),
OCL_NULL( 2 ), ///< pct_pass_transported / pct_mail_transported, now computed on the fly
@@ -1301,10 +1302,10 @@ bool LoadOldVehicle(LoadgameState *ls, int num)
switch (v->spritenum) {
case 2: // oil tanker && cargo type != oil
if (v->cargo_type != CT_OIL) v->spritenum = 0; // make it a coal/goods ship
if (v->cargo_type != 3) v->spritenum = 0; // make it a coal/goods ship
break;
case 4: // passenger ship && cargo type == mail
if (v->cargo_type == CT_MAIL) v->spritenum = 0; // make it a mail ship
if (v->cargo_type == 2) v->spritenum = 0; // make it a mail ship
break;
default:
break;
+28 -40
View File
@@ -89,14 +89,14 @@ struct ReadBuffer {
byte buf[MEMORY_CHUNK_SIZE]; ///< Buffer we're going to read from.
byte *bufp; ///< Location we're at reading the buffer.
byte *bufe; ///< End of the buffer we can read from.
LoadFilter *reader; ///< The filter used to actually read.
std::shared_ptr<LoadFilter> reader; ///< The filter used to actually read.
size_t read; ///< The amount of read bytes so far from the filter.
/**
* Initialise our variables.
* @param reader The filter to actually read data.
*/
ReadBuffer(LoadFilter *reader) : bufp(nullptr), bufe(nullptr), reader(reader), read(0)
ReadBuffer(std::shared_ptr<LoadFilter> reader) : bufp(nullptr), bufe(nullptr), reader(reader), read(0)
{
}
@@ -163,7 +163,7 @@ struct MemoryDumper {
* Flush this dumper into a writer.
* @param writer The filter we want to use.
*/
void Flush(SaveFilter *writer)
void Flush(std::shared_ptr<SaveFilter> writer)
{
uint i = 0;
size_t t = this->GetSize();
@@ -199,11 +199,11 @@ struct SaveLoadParams {
int array_index, last_array_index; ///< in the case of an array, the current and last positions
bool expect_table_header; ///< In the case of a table, if the header is saved/loaded.
MemoryDumper *dumper; ///< Memory dumper to write the savegame to.
SaveFilter *sf; ///< Filter to write the savegame to.
std::unique_ptr<MemoryDumper> dumper; ///< Memory dumper to write the savegame to.
std::shared_ptr<SaveFilter> sf; ///< Filter to write the savegame to.
ReadBuffer *reader; ///< Savegame reading buffer.
LoadFilter *lf; ///< Filter to read the savegame from.
std::unique_ptr<ReadBuffer> reader; ///< Savegame reading buffer.
std::shared_ptr<LoadFilter> lf; ///< Filter to read the savegame from.
StringID error_str; ///< the translatable error message to show
std::string extra_msg; ///< the error message
@@ -2176,9 +2176,6 @@ struct FileReader : LoadFilter {
{
if (this->file != nullptr) fclose(this->file);
this->file = nullptr;
/* Make sure we don't double free. */
_sl.sf = nullptr;
}
size_t Read(byte *buf, size_t size) override
@@ -2214,9 +2211,6 @@ struct FileWriter : SaveFilter {
~FileWriter()
{
this->Finish();
/* Make sure we don't double free. */
_sl.sf = nullptr;
}
void Write(byte *buf, size_t size) override
@@ -2250,7 +2244,7 @@ struct LZOLoadFilter : LoadFilter {
* Initialise this filter.
* @param chain The next filter in this chain.
*/
LZOLoadFilter(LoadFilter *chain) : LoadFilter(chain)
LZOLoadFilter(std::shared_ptr<LoadFilter> chain) : LoadFilter(chain)
{
if (lzo_init() != LZO_E_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize decompressor");
}
@@ -2297,7 +2291,7 @@ struct LZOSaveFilter : SaveFilter {
* Initialise this filter.
* @param chain The next filter in this chain.
*/
LZOSaveFilter(SaveFilter *chain, byte) : SaveFilter(chain)
LZOSaveFilter(std::shared_ptr<SaveFilter> chain, byte) : SaveFilter(chain)
{
if (lzo_init() != LZO_E_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize compressor");
}
@@ -2337,7 +2331,7 @@ struct NoCompLoadFilter : LoadFilter {
* Initialise this filter.
* @param chain The next filter in this chain.
*/
NoCompLoadFilter(LoadFilter *chain) : LoadFilter(chain)
NoCompLoadFilter(std::shared_ptr<LoadFilter> chain) : LoadFilter(chain)
{
}
@@ -2353,7 +2347,7 @@ struct NoCompSaveFilter : SaveFilter {
* Initialise this filter.
* @param chain The next filter in this chain.
*/
NoCompSaveFilter(SaveFilter *chain, byte) : SaveFilter(chain)
NoCompSaveFilter(std::shared_ptr<SaveFilter> chain, byte) : SaveFilter(chain)
{
}
@@ -2379,7 +2373,7 @@ struct ZlibLoadFilter : LoadFilter {
* Initialise this filter.
* @param chain The next filter in this chain.
*/
ZlibLoadFilter(LoadFilter *chain) : LoadFilter(chain)
ZlibLoadFilter(std::shared_ptr<LoadFilter> chain) : LoadFilter(chain)
{
memset(&this->z, 0, sizeof(this->z));
if (inflateInit(&this->z) != Z_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize decompressor");
@@ -2424,7 +2418,7 @@ struct ZlibSaveFilter : SaveFilter {
* @param chain The next filter in this chain.
* @param compression_level The requested level of compression.
*/
ZlibSaveFilter(SaveFilter *chain, byte compression_level) : SaveFilter(chain)
ZlibSaveFilter(std::shared_ptr<SaveFilter> chain, byte compression_level) : SaveFilter(chain)
{
memset(&this->z, 0, sizeof(this->z));
if (deflateInit(&this->z, compression_level) != Z_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize compressor");
@@ -2508,7 +2502,7 @@ struct LZMALoadFilter : LoadFilter {
* Initialise this filter.
* @param chain The next filter in this chain.
*/
LZMALoadFilter(LoadFilter *chain) : LoadFilter(chain), lzma(_lzma_init)
LZMALoadFilter(std::shared_ptr<LoadFilter> chain) : LoadFilter(chain), lzma(_lzma_init)
{
/* Allow saves up to 256 MB uncompressed */
if (lzma_auto_decoder(&this->lzma, 1 << 28, 0) != LZMA_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize decompressor");
@@ -2552,7 +2546,7 @@ struct LZMASaveFilter : SaveFilter {
* @param chain The next filter in this chain.
* @param compression_level The requested level of compression.
*/
LZMASaveFilter(SaveFilter *chain, byte compression_level) : SaveFilter(chain), lzma(_lzma_init)
LZMASaveFilter(std::shared_ptr<SaveFilter> chain, byte compression_level) : SaveFilter(chain), lzma(_lzma_init)
{
if (lzma_easy_encoder(&this->lzma, compression_level, LZMA_CHECK_CRC32) != LZMA_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize compressor");
}
@@ -2621,7 +2615,7 @@ struct ZSTDLoadFilter : LoadFilter {
* Initialise this filter.
* @param chain The next filter in this chain.
*/
ZSTDLoadFilter(LoadFilter *chain) : LoadFilter(chain)
ZSTDLoadFilter(std::shared_ptr<LoadFilter> chain) : LoadFilter(chain)
{
this->zstd = ZSTD_createDCtx();
if (!this->zstd) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize compressor");
@@ -2663,7 +2657,7 @@ struct ZSTDSaveFilter : SaveFilter {
* @param chain The next filter in this chain.
* @param compression_level The requested level of compression.
*/
ZSTDSaveFilter(SaveFilter *chain, byte compression_level) : SaveFilter(chain)
ZSTDSaveFilter(std::shared_ptr<SaveFilter> chain, byte compression_level) : SaveFilter(chain)
{
this->zstd = ZSTD_createCCtx();
if (!this->zstd) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize compressor");
@@ -2720,12 +2714,13 @@ struct ZSTDSaveFilter : SaveFilter {
*******************************************/
/** The format for a reader/writer type of a savegame */
// CityMania moved to saveload.h
// struct SaveLoadFormat {
// const char *name; ///< name of the compressor/decompressor (debug-only)
// uint32_t tag; ///< the 4-letter tag by which it is identified in the savegame
// LoadFilter *(*init_load)(LoadFilter *chain); ///< Constructor for the load filter.
// SaveFilter *(*init_write)(SaveFilter *chain, byte compression); ///< Constructor for the save filter.
// std::shared_ptr<LoadFilter> (*init_load)(std::shared_ptr<LoadFilter> chain); ///< Constructor for the load filter.
// std::shared_ptr<SaveFilter> (*init_write)(std::shared_ptr<SaveFilter> chain, byte compression); ///< Constructor for the save filter.
// byte min_compression; ///< the minimum compression level of this format
// byte default_compression; ///< the default compression level of this format
@@ -2943,16 +2938,9 @@ static void ResetSaveloadData()
*/
static inline void ClearSaveLoadState()
{
delete _sl.dumper;
_sl.dumper = nullptr;
delete _sl.sf;
_sl.sf = nullptr;
delete _sl.reader;
_sl.reader = nullptr;
delete _sl.lf;
_sl.lf = nullptr;
}
@@ -3065,11 +3053,11 @@ void WaitTillSaved()
* @param threaded Whether to try to perform the saving asynchronously.
* @return Return the result of the action. #SL_OK or #SL_ERROR
*/
static SaveOrLoadResult DoSave(SaveFilter *writer, bool threaded, citymania::SavePreset preset)
static SaveOrLoadResult DoSave(std::shared_ptr<SaveFilter> writer, bool threaded, citymania::SavePreset preset)
{
assert(!_sl.saveinprogress);
_sl.dumper = new MemoryDumper();
_sl.dumper = std::make_unique<MemoryDumper>();
_sl.sf = writer;
_sl_version = SAVEGAME_VERSION;
@@ -3097,7 +3085,7 @@ static SaveOrLoadResult DoSave(SaveFilter *writer, bool threaded, citymania::Sav
* @param threaded Whether to try to perform the saving asynchronously.
* @return Return the result of the action. #SL_OK or #SL_ERROR
*/
SaveOrLoadResult SaveWithFilter(SaveFilter *writer, bool threaded, citymania::SavePreset preset)
SaveOrLoadResult SaveWithFilter(std::shared_ptr<SaveFilter> writer, bool threaded, citymania::SavePreset preset)
{
try {
_sl.action = SLA_SAVE;
@@ -3114,7 +3102,7 @@ SaveOrLoadResult SaveWithFilter(SaveFilter *writer, bool threaded, citymania::Sa
* @param load_check Whether to perform the checking ("preview") or actually load the game.
* @return Return the result of the action. #SL_OK or #SL_REINIT ("unload" the game)
*/
static SaveOrLoadResult DoLoad(LoadFilter *reader, bool load_check)
static SaveOrLoadResult DoLoad(std::shared_ptr<LoadFilter> reader, bool load_check)
{
_sl.lf = reader;
@@ -3178,7 +3166,7 @@ static SaveOrLoadResult DoLoad(LoadFilter *reader, bool load_check)
Debug(sl, 2, "Using saveload format '%s'", fmt->name);
_sl.lf = fmt->init_load(_sl.lf);
_sl.reader = new ReadBuffer(_sl.lf);
_sl.reader = std::make_unique<ReadBuffer>(_sl.lf);
_next_offs = 0;
if (!load_check) {
@@ -3255,7 +3243,7 @@ static SaveOrLoadResult DoLoad(LoadFilter *reader, bool load_check)
* @param reader The filter to read the savegame from.
* @return Return the result of the action. #SL_OK or #SL_REINIT ("unload" the game)
*/
SaveOrLoadResult LoadWithFilter(LoadFilter *reader)
SaveOrLoadResult LoadWithFilter(std::shared_ptr<LoadFilter> reader)
{
try {
_sl.action = SLA_LOAD;
@@ -3342,13 +3330,13 @@ SaveOrLoadResult SaveOrLoad(const std::string &filename, SaveLoadOperation fop,
Debug(desync, 1, "save: {:08x}; {:02x}; {}", TimerGameEconomy::date, TimerGameEconomy::date_fract, filename);
if (!_settings_client.gui.threaded_saves) threaded = false;
return DoSave(new FileWriter(fh), threaded, citymania::GetLocalSavePreset());
return DoSave(std::make_shared<FileWriter>(fh), threaded, citymania::GetLocalSavePreset());
}
/* LOAD game */
assert(fop == SLO_LOAD || fop == SLO_CHECK);
Debug(desync, 1, "load: {}", filename);
return DoLoad(new FileReader(fh), fop == SLO_CHECK);
return DoLoad(std::make_shared<FileReader>(fh), fop == SLO_CHECK);
} catch (...) {
/* This code may be executed both for old and new save games. */
ClearSaveLoadState();
+4 -4
View File
@@ -426,8 +426,8 @@ struct SaveLoadFormat {
const char *name; ///< name of the compressor/decompressor (debug-only)
uint32_t tag; ///< the 4-letter tag by which it is identified in the savegame
LoadFilter *(*init_load)(LoadFilter *chain); ///< Constructor for the load filter.
SaveFilter *(*init_write)(SaveFilter *chain, byte compression); ///< Constructor for the save filter.
std::shared_ptr<LoadFilter> (*init_load)(std::shared_ptr<LoadFilter> chain); ///< Constructor for the load filter.
std::shared_ptr<SaveFilter> (*init_write)(std::shared_ptr<SaveFilter> chain, byte compression); ///< Constructor for the save filter.
CompressionMethod method; ///< compression method used in this format
byte min_compression; ///< the minimum compression level of this format
@@ -458,8 +458,8 @@ void DoExitSave();
void DoAutoOrNetsave(FiosNumberedSaveName &counter);
SaveOrLoadResult SaveWithFilter(struct SaveFilter *writer, bool threaded, citymania::SavePreset preset);
SaveOrLoadResult LoadWithFilter(struct LoadFilter *reader);
SaveOrLoadResult SaveWithFilter(std::shared_ptr<struct SaveFilter> writer, bool threaded, citymania::SavePreset preset);
SaveOrLoadResult LoadWithFilter(std::shared_ptr<struct LoadFilter> reader);
typedef void AutolengthProc(void *arg);
+8 -10
View File
@@ -13,20 +13,19 @@
/** Interface for filtering a savegame till it is loaded. */
struct LoadFilter {
/** Chained to the (savegame) filters. */
LoadFilter *chain;
std::shared_ptr<LoadFilter> chain;
/**
* Initialise this filter.
* @param chain The next filter in this chain.
*/
LoadFilter(LoadFilter *chain) : chain(chain)
LoadFilter(std::shared_ptr<LoadFilter> chain) : chain(chain)
{
}
/** Make sure the writers are properly closed. */
virtual ~LoadFilter()
{
delete this->chain;
}
/**
@@ -51,28 +50,27 @@ struct LoadFilter {
* @param chain The next filter in this chain.
* @tparam T The type of load filter to create.
*/
template <typename T> LoadFilter *CreateLoadFilter(LoadFilter *chain)
template <typename T> std::shared_ptr<LoadFilter> CreateLoadFilter(std::shared_ptr<LoadFilter> chain)
{
return new T(chain);
return std::make_shared<T>(chain);
}
/** Interface for filtering a savegame till it is written. */
struct SaveFilter {
/** Chained to the (savegame) filters. */
SaveFilter *chain;
std::shared_ptr<SaveFilter> chain;
/**
* Initialise this filter.
* @param chain The next filter in this chain.
*/
SaveFilter(SaveFilter *chain) : chain(chain)
SaveFilter(std::shared_ptr<SaveFilter> chain) : chain(chain)
{
}
/** Make sure the writers are properly closed. */
virtual ~SaveFilter()
{
delete this->chain;
}
/**
@@ -97,9 +95,9 @@ struct SaveFilter {
* @param compression_level The requested level of compression.
* @tparam T The type of save filter to create.
*/
template <typename T> SaveFilter *CreateSaveFilter(SaveFilter *chain, byte compression_level)
template <typename T> std::shared_ptr<SaveFilter> CreateSaveFilter(std::shared_ptr<SaveFilter> chain, byte compression_level)
{
return new T(chain, compression_level);
return std::make_shared<T>(chain, compression_level);
}
#endif /* SAVELOAD_FILTER_H */
+17 -16
View File
@@ -226,22 +226,23 @@ static const SaveLoad _town_desc[] = {
SLE_CONDARR(Town, unwanted, SLE_INT8, 8, SLV_4, SLV_104),
SLE_CONDARR(Town, unwanted, SLE_INT8, MAX_COMPANIES, SLV_104, SL_MAX_VERSION),
SLE_CONDVAR(Town, supplied[CT_PASSENGERS].old_max, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVAR(Town, supplied[CT_PASSENGERS].old_max, SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVAR(Town, supplied[CT_MAIL].old_max, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVAR(Town, supplied[CT_MAIL].old_max, SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVAR(Town, supplied[CT_PASSENGERS].new_max, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVAR(Town, supplied[CT_PASSENGERS].new_max, SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVAR(Town, supplied[CT_MAIL].new_max, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVAR(Town, supplied[CT_MAIL].new_max, SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVAR(Town, supplied[CT_PASSENGERS].old_act, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVAR(Town, supplied[CT_PASSENGERS].old_act, SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVAR(Town, supplied[CT_MAIL].old_act, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVAR(Town, supplied[CT_MAIL].old_act, SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVAR(Town, supplied[CT_PASSENGERS].new_act, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVAR(Town, supplied[CT_PASSENGERS].new_act, SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVAR(Town, supplied[CT_MAIL].new_act, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVAR(Town, supplied[CT_MAIL].new_act, SLE_UINT32, SLV_9, SLV_165),
/* Slots 0 and 2 are passengers and mail respectively for old saves. */
SLE_CONDVARNAME(Town, supplied[0].old_max, "supplied[CT_PASSENGERS].old_max", SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVARNAME(Town, supplied[0].old_max, "supplied[CT_PASSENGERS].old_max", SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVARNAME(Town, supplied[2].old_max, "supplied[CT_MAIL].old_max", SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVARNAME(Town, supplied[2].old_max, "supplied[CT_MAIL].old_max", SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVARNAME(Town, supplied[0].new_max, "supplied[CT_PASSENGERS].new_max", SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVARNAME(Town, supplied[0].new_max, "supplied[CT_PASSENGERS].new_max", SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVARNAME(Town, supplied[2].new_max, "supplied[CT_MAIL].new_max", SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVARNAME(Town, supplied[2].new_max, "supplied[CT_MAIL].new_max", SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVARNAME(Town, supplied[0].old_act, "supplied[CT_PASSENGERS].old_act", SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVARNAME(Town, supplied[0].old_act, "supplied[CT_PASSENGERS].old_act", SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVARNAME(Town, supplied[2].old_act, "supplied[CT_MAIL].old_act", SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVARNAME(Town, supplied[2].old_act, "supplied[CT_MAIL].old_act", SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVARNAME(Town, supplied[0].new_act, "supplied[CT_PASSENGERS].new_act", SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVARNAME(Town, supplied[0].new_act, "supplied[CT_PASSENGERS].new_act", SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVARNAME(Town, supplied[2].new_act, "supplied[CT_MAIL].new_act", SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_9),
SLE_CONDVARNAME(Town, supplied[2].new_act, "supplied[CT_MAIL].new_act", SLE_UINT32, SLV_9, SLV_165),
SLE_CONDVARNAME(Town, received[TAE_FOOD].old_act, "received[TE_FOOD].old_act", SLE_UINT16, SL_MIN_VERSION, SLV_165),
SLE_CONDVARNAME(Town, received[TAE_WATER].old_act, "received[TE_WATER].old_act", SLE_UINT16, SL_MIN_VERSION, SLV_165),