Remove: buying/selling/owning company shares (#10709)

This commit is contained in:
Patric Stout
2023-04-29 10:16:49 +02:00
committed by GitHub
parent 1a24016964
commit 36a0818bc5
19 changed files with 10 additions and 319 deletions

View File

@@ -1775,21 +1775,6 @@ bool AfterLoadGame()
}
}
if (IsSavegameVersionBefore(SLV_84)) {
/* Set all share owners to INVALID_COMPANY for
* 1) all inactive companies
* (when inactive companies were stored in the savegame - TTD, TTDP and some
* *really* old revisions of OTTD; else it is already set in InitializeCompanies())
* 2) shares that are owned by inactive companies or self
* (caused by cheating clients in earlier revisions) */
for (Company *c : Company::Iterate()) {
for (auto &share_owner : c->share_owners) {
if (share_owner == INVALID_COMPANY) continue;
if (!Company::IsValidID(share_owner) || share_owner == c->index) share_owner = INVALID_COMPANY;
}
}
}
/* The water class was moved/unified. */
if (IsSavegameVersionBefore(SLV_146)) {
for (auto t : Map::Iterate()) {

View File

@@ -470,8 +470,6 @@ static const SaveLoad _company_desc[] = {
SLE_CONDVAR(CompanyProperties, inaugurated_year, SLE_FILE_U8 | SLE_VAR_I32, SL_MIN_VERSION, SLV_31),
SLE_CONDVAR(CompanyProperties, inaugurated_year, SLE_INT32, SLV_31, SL_MAX_VERSION),
SLE_ARR(CompanyProperties, share_owners, SLE_UINT8, 4),
SLE_CONDVAR(CompanyProperties, num_valid_stat_ent, SLE_UINT8, SL_MIN_VERSION, SLV_SAVELOAD_LIST_LENGTH),
SLE_VAR(CompanyProperties, months_of_bankruptcy, SLE_UINT8),

View File

@@ -106,7 +106,7 @@ const SaveLoadCompat _company_sl_compat[] = {
SLC_VAR("location_of_HQ"),
SLC_VAR("last_build_coordinate"),
SLC_VAR("inaugurated_year"),
SLC_VAR("share_owners"),
SLC_NULL(4, SL_MIN_VERSION, SLV_TABLE_CHUNKS),
SLC_VAR("num_valid_stat_ent"),
SLC_VAR("months_of_bankruptcy"),
SLC_VAR("bankrupt_asked"),

View File

@@ -154,8 +154,8 @@ const SaveLoadCompat _settings_sl_compat[] = {
SLC_NULL(4, SL_MIN_VERSION, SLV_105),
SLC_VAR("game_creation.ending_year"),
SLC_VAR("economy.type"),
SLC_VAR("economy.allow_shares"),
SLC_VAR("economy.min_years_for_shares"),
SLC_NULL(1, SL_MIN_VERSION, SLV_TABLE_CHUNKS),
SLC_NULL(1, SLV_TRADING_AGE, SLV_TABLE_CHUNKS),
SLC_VAR("economy.feeder_payment_share"),
SLC_VAR("economy.town_growth_rate"),
SLC_VAR("economy.larger_towns"),

View File

@@ -950,10 +950,8 @@ static const OldChunks _company_chunk[] = {
OCL_CNULL( OC_TTD, 1 ), // Old AI
OCL_CNULL( OC_TTD, 1 ), // avail_railtypes
OCL_SVAR( OC_TILE, Company, location_of_HQ ),
OCL_SVAR( OC_TTD | OC_UINT8, Company, share_owners[0] ),
OCL_SVAR( OC_TTD | OC_UINT8, Company, share_owners[1] ),
OCL_SVAR( OC_TTD | OC_UINT8, Company, share_owners[2] ),
OCL_SVAR( OC_TTD | OC_UINT8, Company, share_owners[3] ),
OCL_NULL( 4 ), // Shares
OCL_CNULL( OC_TTD, 8 ), ///< junk at end of chunk