From 97cfd40649abab832315f00e6a07e5b6b9a17e23 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Wed, 12 Apr 2023 14:52:37 -0400 Subject: [PATCH] Fix #10630: Don't allow shifting service date earlier than 0 (#10643) --- src/vehicle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vehicle.cpp b/src/vehicle.cpp index bf35856f88..a979d4de3f 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -771,7 +771,7 @@ uint32 Vehicle::GetGRFID() const */ void Vehicle::ShiftDates(int interval) { - this->date_of_last_service += interval; + this->date_of_last_service = std::max(this->date_of_last_service + interval, 0); } /**