(svn r23931) -Change: Scale infrastructure cost of rail tracks by the total number of all tracks and not independently for each rail type.

This commit is contained in:
michi_cc
2012-02-11 22:43:39 +00:00
parent 67bab7a441
commit 7f06f392f7
6 changed files with 27 additions and 11 deletions

View File

@@ -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;