1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-20 19:02:41 +01:00

Fix #15079: Incorrect dates shown on town cargo history graph. (#15080)

This commit is contained in:
Peter Nelson
2026-01-11 00:03:56 +00:00
committed by GitHub
parent 18f2f7eb2d
commit cc28e19052

View File

@@ -1866,7 +1866,6 @@ struct TownCargoGraphWindow : BaseCargoGraphWindow {
this->num_on_x_axis = GRAPH_NUM_MONTHS;
this->num_vert_lines = GRAPH_NUM_MONTHS;
this->month_increment = 1;
this->x_values_reversed = true;
this->x_values_increment = ECONOMY_MONTH_MINUTES;
this->draw_dates = !TimerGameEconomy::UsingWallclockUnits();
this->ranges = RANGE_LABELS;
@@ -1905,7 +1904,7 @@ struct TownCargoGraphWindow : BaseCargoGraphWindow {
void UpdateStatistics(bool initialize) override
{
int mo = TimerGameEconomy::month - this->num_vert_lines;
int mo = (TimerGameEconomy::month / this->month_increment - this->num_vert_lines) * this->month_increment;
auto yr = TimerGameEconomy::year;
while (mo < 0) {
yr--;