1
0
Fork 0

Codechange: Use economy dates for economy statistics and interest payments

pull/11588/head
Tyler Trahan 2023-02-03 10:56:14 -05:00
parent 8601dd5a4f
commit ee5868f4b4
1 changed files with 4 additions and 4 deletions

View File

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