summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-05-19 21:03:23 +0000
committerfrosch <frosch@openttd.org>2011-05-19 21:03:23 +0000
commitebb4f0513a3ae252e27295303ab83dd14d9ac885 (patch)
tree0e6e040a62773ac02d3239aa63b8d5462fff1845
parent1e90bc0d30f0276ff0a817d1587d71d9a26c47e4 (diff)
downloadopenttd-ebb4f0513a3ae252e27295303ab83dd14d9ac885.tar.xz
(svn r22479) -Codechange/Fix: Months != quarters. (xi)
-rw-r--r--src/company_base.h8
-rw-r--r--src/company_type.h2
-rw-r--r--src/economy.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/company_base.h b/src/company_base.h
index de1bbeb1b..d90e525ed 100644
--- a/src/company_base.h
+++ b/src/company_base.h
@@ -78,10 +78,10 @@ struct CompanyProperties {
*/
bool is_ai;
- Money yearly_expenses[3][EXPENSES_END]; ///< Expenses of the company for the last three years, in every #Expenses category.
- CompanyEconomyEntry cur_economy; ///< Economic data of the company of this quarter.
- CompanyEconomyEntry old_economy[MAX_HISTORY_MONTHS]; ///< Economic data of the company of the last #MAX_HISTORY_MONTHS months.
- byte num_valid_stat_ent; ///< Number of valid statistical entries in #old_economy.
+ Money yearly_expenses[3][EXPENSES_END]; ///< Expenses of the company for the last three years, in every #Expenses category.
+ CompanyEconomyEntry cur_economy; ///< Economic data of the company of this quarter.
+ CompanyEconomyEntry old_economy[MAX_HISTORY_QUARTERS]; ///< Economic data of the company of the last #MAX_HISTORY_QUARTERS quarters.
+ byte num_valid_stat_ent; ///< Number of valid statistical entries in #old_economy.
CompanyProperties() : name(NULL), president_name(NULL) {}
diff --git a/src/company_type.h b/src/company_type.h
index 922b63364..aa73abe63 100644
--- a/src/company_type.h
+++ b/src/company_type.h
@@ -40,7 +40,7 @@ DECLARE_POSTFIX_INCREMENT(Owner)
static const uint MAX_LENGTH_PRESIDENT_NAME_CHARS = 32; ///< The maximum length of a president name in characters including '\0'
static const uint MAX_LENGTH_COMPANY_NAME_CHARS = 32; ///< The maximum length of a company name in characters including '\0'
-static const uint MAX_HISTORY_MONTHS = 24; ///< The maximum number of months kept as performance's history
+static const uint MAX_HISTORY_QUARTERS = 24; ///< The maximum number of quarters kept as performance's history
/** Define basic enum properties */
template <> struct EnumPropsT<Owner> : MakeEnumPropsT<Owner, byte, OWNER_BEGIN, OWNER_END, INVALID_OWNER> {};
diff --git a/src/economy.cpp b/src/economy.cpp
index 6f2604c27..9562dd5a1 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -565,7 +565,7 @@ static void CompaniesGenStatistics()
c->old_economy[0] = c->cur_economy;
memset(&c->cur_economy, 0, sizeof(c->cur_economy));
- if (c->num_valid_stat_ent != MAX_HISTORY_MONTHS) c->num_valid_stat_ent++;
+ if (c->num_valid_stat_ent != MAX_HISTORY_QUARTERS) c->num_valid_stat_ent++;
UpdateCompanyRatingAndValue(c, true);
if (c->block_preview != 0) c->block_preview--;