Adjust handling of year display in wallclock mode and company inauguration years

See: #657
This commit is contained in:
Jonathan G Rennison
2024-02-24 23:35:20 +00:00
parent 1bfcbf823c
commit 090656bd7f
16 changed files with 75 additions and 15 deletions

View File

@@ -636,6 +636,7 @@ Company *DoStartupNewCompany(DoStartupNewCompanyFlag flags, CompanyID company)
c->avail_railtypes = GetCompanyRailTypes(c->index);
c->avail_roadtypes = GetCompanyRoadTypes(c->index);
c->inaugurated_year = CalTime::CurYear();
c->display_inaugurated_period = EconTime::Detail::WallClockYearToDisplay(EconTime::CurYear());
/* If starting a player company in singleplayer and a favorite company manager face is selected, choose it. Otherwise, use a random face.
* In a network game, we'll choose the favorite face later in CmdCompanyCtrl to sync it to all clients. */
@@ -864,6 +865,7 @@ void CompaniesYearlyLoop()
/* Move expenses to previous years. */
std::rotate(std::rbegin(c->yearly_expenses), std::rbegin(c->yearly_expenses) + 1, std::rend(c->yearly_expenses));
c->yearly_expenses[0] = {};
c->age_years++;
SetWindowDirty(WC_FINANCES, c->index);
}