From ee5868f4b491105e52565cb037b0f66f9306956f Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Fri, 3 Feb 2023 10:56:14 -0500 Subject: [PATCH] Codechange: Use economy dates for economy statistics and interest payments --- src/economy.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/economy.cpp b/src/economy.cpp index be8f9c9a77..7143fbdc93 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -691,8 +691,8 @@ static void CompaniesGenStatistics() } cur_company.Restore(); - /* Only run the economic statics and update company stats every 3rd month (1st of quarter). */ - if (!HasBit(1 << 0 | 1 << 3 | 1 << 6 | 1 << 9, TimerGameCalendar::month)) return; + /* Only run the economic statics and update company stats every 3rd economy month (1st of quarter). */ + if (!HasBit(1 << 0 | 1 << 3 | 1 << 6 | 1 << 9, TimerGameEconomy::month)) return; for (Company *c : Company::Iterate()) { /* Drop the oldest history off the end */ @@ -845,8 +845,8 @@ static void CompaniesPayInterest() if (c->money < 0) { yearly_fee += -c->money *_economy.interest_rate / 100; } - Money up_to_previous_month = yearly_fee * TimerGameCalendar::month / 12; - Money up_to_this_month = yearly_fee * (TimerGameCalendar::month + 1) / 12; + Money up_to_previous_month = yearly_fee * TimerGameEconomy::month / 12; + Money up_to_this_month = yearly_fee * (TimerGameEconomy::month + 1) / 12; SubtractMoneyFromCompany(CommandCost(EXPENSES_LOAN_INTEREST, up_to_this_month - up_to_previous_month));