diff options
author | nchappe <74881848+nchappe@users.noreply.github.com> | 2021-11-19 00:04:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-19 00:04:22 +0000 |
commit | 2cb6351af596178ac3169baeffbc5a827f9aad5f (patch) | |
tree | e40780f85eb7ebb5d7e188626c9d6d82e6fd148d /src/vehicle.cpp | |
parent | 0533b666b7036750ed0b004f22f933625391dd8e (diff) | |
download | openttd-2cb6351af596178ac3169baeffbc5a827f9aad5f.tar.xz |
Fix: Update last servicing dates when using the date cheat (#9694)
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 9e2292751..30e1c477c 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -764,6 +764,16 @@ uint32 Vehicle::GetGRFID() const } /** + * 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 * event to the AIs and a news message to the user. If the |