From 0542e26460cf5da6fb4a3486ed9b515721bdb0bd Mon Sep 17 00:00:00 2001 From: michi_cc Date: Sat, 11 Feb 2012 22:43:39 +0000 Subject: (svn r23931) -Change: Scale infrastructure cost of rail tracks by the total number of all tracks and not independently for each rail type. --- src/company_base.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/company_base.h') 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 CompanyPool; -- cgit v1.2.3-54-g00ecf