MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ShiftDates

Method ShiftDates

src/vehicle.cpp:748–753  ·  view source on GitHub ↗

* 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 subtracted. */

Source from the content-addressed store, hash-verified

746 * @param interval Number of days to be added or subtracted.
747 */
748void Vehicle::ShiftDates(TimerGameEconomy::Date interval)
749{
750 this->date_of_last_service = std::max(this->date_of_last_service + interval, TimerGameEconomy::Date(0));
751 /* date_of_last_service_newgrf is not updated here as it must stay stable
752 * for vehicles outside of a depot. */
753}
754
755/**
756 * Handle the pathfinding result, especially the lost status.

Callers 3

SetStartingYearFunction · 0.45
ClickChangeDateCheatFunction · 0.45
ChangeTimekeepingUnitsFunction · 0.45

Calls 1

DateEnum · 0.85

Tested by

no test coverage detected