Fix #10630: Don't allow shifting service date earlier than 0 (#10643)

pull/510/head
Tyler Trahan 1 year ago committed by GitHub
parent a0d8545f6c
commit 97cfd40649
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -771,7 +771,7 @@ uint32 Vehicle::GetGRFID() const
*/ */
void Vehicle::ShiftDates(int interval) 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);
} }
/** /**

Loading…
Cancel
Save