diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1845,13 +1845,21 @@ void DeleteVehicleOrders(Vehicle *v, boo /** * Clamp the service interval to the correct min/max. The actual min/max values - * depend on whether it's in percent or days. - * @param interval proposed service interval - * @return Clamped service interval + * depend on whether it's in days, minutes, or percent. + * @param interval The proposed service interval. + * @param ispercent Whether the interval is a percent. + * @return The service interval clamped to use the chosen units. */ uint16_t GetServiceIntervalClamped(int interval, bool ispercent) { - return ispercent ? Clamp(interval, MIN_SERVINT_PERCENT, MAX_SERVINT_PERCENT) : Clamp(interval, MIN_SERVINT_DAYS, MAX_SERVINT_DAYS); + /* Service intervals are in percents. */ + if (ispercent) return Clamp(interval, MIN_SERVINT_PERCENT, MAX_SERVINT_PERCENT); + + /* Service intervals are in minutes. */ + if (TimerGameEconomy::UsingWallclockUnits(_game_mode == GM_MENU)) return Clamp(interval, MIN_SERVINT_MINUTES, MAX_SERVINT_MINUTES); + + /* Service intervals are in days. */ + return Clamp(interval, MIN_SERVINT_DAYS, MAX_SERVINT_DAYS); } /**