From 2cb6351af596178ac3169baeffbc5a827f9aad5f Mon Sep 17 00:00:00 2001 From: nchappe <74881848+nchappe@users.noreply.github.com> Date: Fri, 19 Nov 2021 00:04:22 +0000 Subject: Fix: Update last servicing dates when using the date cheat (#9694) --- src/vehicle.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/vehicle.cpp') diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 9e2292751..30e1c477c 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -763,6 +763,16 @@ uint32 Vehicle::GetGRFID() const return this->GetEngine()->GetGRFID(); } +/** + * Shift all dates by given interval. + * This is useful if the date has been modified with the cheat menu. + * @param interval Number of days to be added or substracted. + */ +void Vehicle::ShiftDates(int interval) +{ + this->date_of_last_service += interval; +} + /** * Handle the pathfinding result, especially the lost status. * If the vehicle is now lost and wasn't previously fire an -- cgit v1.2.3-70-g09d2