1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-21 11:22:45 +01:00

Fix: Update last servicing dates when using the date cheat (#9694)

This commit is contained in:
nchappe
2021-11-19 00:04:22 +00:00
committed by Patric Stout
parent 521287839b
commit a4428a0cbe
4 changed files with 15 additions and 1 deletions

View File

@@ -14,6 +14,7 @@
#include "company_func.h"
#include "date_func.h"
#include "saveload/saveload.h"
#include "vehicle_base.h"
#include "textbuf_gui.h"
#include "window_gui.h"
#include "string_func.h"
@@ -106,6 +107,7 @@ static int32 ClickChangeDateCheat(int32 p1, int32 p2)
if (p1 == _cur_year) return _cur_year;
Date new_date = ConvertYMDToDate(p1, ymd.month, ymd.day);
for (auto v : Vehicle::Iterate()) v->ShiftDates(new_date - _date);
LinkGraphSchedule::instance.ShiftDates(new_date - _date);
SetDate(new_date, _date_fract);
EnginesMonthlyLoop();