diff options
author | michi_cc <michi_cc@openttd.org> | 2012-02-11 22:43:39 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2012-02-11 22:43:39 +0000 |
commit | 0542e26460cf5da6fb4a3486ed9b515721bdb0bd (patch) | |
tree | 901640a66314b34ff1bc6a72b67dc288683a79c9 /src/company_base.h | |
parent | 1cf2f521ab32279b6770a79e7fb50ef5bbcd4011 (diff) | |
download | openttd-0542e26460cf5da6fb4a3486ed9b515721bdb0bd.tar.xz |
(svn r23931) -Change: Scale infrastructure cost of rail tracks by the total number of all tracks and not independently for each rail type.
Diffstat (limited to 'src/company_base.h')
-rw-r--r-- | src/company_base.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/company_base.h b/src/company_base.h index 58c0a0ce0..0f9e8ae10 100644 --- a/src/company_base.h +++ b/src/company_base.h @@ -35,6 +35,14 @@ struct CompanyInfrastructure { uint32 water; ///< Count of company owned track bits for canals. uint32 station; ///< Count of company owned station tiles. uint32 airport; ///< Count of company owned airports. + + /** Get total sum of all owned track bits. */ + uint32 GetRailTotal() const + { + uint32 total = 0; + for (RailType rt = RAILTYPE_BEGIN; rt < RAILTYPE_END; rt++) total += this->rail[rt]; + return total; + } }; typedef Pool<Company, CompanyByte, 1, MAX_COMPANIES> CompanyPool; |