Re-add company shares

This commit is contained in:
Jonathan G Rennison
2023-05-30 18:57:42 +01:00
parent 6297abdb3b
commit bac8f032da
80 changed files with 1297 additions and 13 deletions

View File

@@ -83,6 +83,8 @@ struct CompanyProperties {
TileIndex location_of_HQ; ///< Northern tile of HQ; #INVALID_TILE when there is none.
TileIndex last_build_coordinate; ///< Coordinate of the last build thing by this company.
std::array<Owner, MAX_COMPANY_SHARE_OWNERS> share_owners; ///< Owners of the shares of the company. #INVALID_OWNER if nobody has bought them yet.
Year inaugurated_year; ///< Year of starting the company.
byte months_of_bankruptcy; ///< Number of months that the company is unable to pay its debts
@@ -118,7 +120,7 @@ struct CompanyProperties {
CompanyProperties()
: name_2(0), name_1(0), president_name_1(0), president_name_2(0),
face(0), money(0), money_fraction(0), current_loan(0), colour(0), block_preview(0),
location_of_HQ(0), last_build_coordinate(0), inaugurated_year(0),
location_of_HQ(0), last_build_coordinate(0), share_owners(), inaugurated_year(0),
months_of_bankruptcy(0), bankrupt_last_asked(INVALID_COMPANY), bankrupt_flags(CBRF_NONE), bankrupt_asked(0), bankrupt_timeout(0), bankrupt_value(0),
terraform_limit(0), clear_limit(0), tree_limit(0), purchase_land_limit(0), build_object_limit(0), is_ai(false), engine_renew_list(nullptr) {}
};
@@ -177,6 +179,7 @@ struct Company : CompanyPool::PoolItem<&_company_pool>, CompanyProperties {
};
Money CalculateCompanyValue(const Company *c, bool including_loan = true);
Money CalculateCompanyValueExcludingShares(const Company *c, bool including_loan = true);
extern uint _cur_company_tick_index;