diff --git a/src/lang/english.txt b/src/lang/english.txt index 2bbf28fdb4..e71f18442f 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1852,7 +1852,10 @@ STR_CONFIG_SETTING_TIMETABLE_SEPARATION_RATE_HELPTEXT :How much of the STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE :Show arrival and departure in timetables: {STRING2} STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE_HELPTEXT :Display anticipated arrival and departure times in timetables STR_CONFIG_SETTING_TIMETABLE_AUTOFILL_ROUNDING_TICKS :Round up auto-filled timetable times to multiples of this many ticks: {STRING2} -STR_CONFIG_SETTING_TIMETABLE_AUTOFILL_ROUNDING_TICKS_HELPTEXT :Timetable times adjusted by timetable automation are not rounded. A day at a a day length of 1 is 74 ticks. +STR_CONFIG_SETTING_TIMETABLE_AUTOFILL_ROUNDING_TICKS_HELPTEXT :Timetable times adjusted by timetable automation are not rounded. A day at a day length of 1 is 74 ticks.{}By default the game ticks per minute value is used if using minutes, otherwise 74 ticks is used. +STR_CONFIG_SETTING_TIMETABLE_AUTOFILL_ROUNDING_TICKS_VALUE :{COMMA}{NBSP}tick{P 0 "" s} +###setting-zero-is-special +STR_CONFIG_SETTING_TIMETABLE_AUTOFILL_ROUNDING_TICKS_DEFAULT :Default STR_CONFIG_SETTING_QUICKGOTO :Quick creation of vehicle orders: {STRING2} STR_CONFIG_SETTING_QUICKGOTO_HELPTEXT :Pre-select the 'goto cursor' when opening the orders window diff --git a/src/table/settings/company_settings.ini b/src/table/settings/company_settings.ini index d1008f4cf0..7502d985b6 100644 --- a/src/table/settings/company_settings.ini +++ b/src/table/settings/company_settings.ini @@ -176,14 +176,14 @@ patxname = ""auto_timetable_separation_rate"" base = CompanySettings var = timetable_autofill_rounding type = SLE_UINT16 -flags = SF_PER_COMPANY -def = 74 -min = 1 +flags = SF_PER_COMPANY | SF_GUI_0_IS_SPECIAL +def = 0 +min = 0 max = 1000 interval = 10 str = STR_CONFIG_SETTING_TIMETABLE_AUTOFILL_ROUNDING_TICKS strhelp = STR_CONFIG_SETTING_TIMETABLE_AUTOFILL_ROUNDING_TICKS_HELPTEXT -strval = STR_JUST_INT +strval = STR_CONFIG_SETTING_TIMETABLE_AUTOFILL_ROUNDING_TICKS_VALUE cat = SC_EXPERT patxname = ""timetable_autofill_rounding"" diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index 38dd35b3b1..13806811b1 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -886,7 +886,8 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling) * Thus always make sure at least one tick is used between the * processing of different orders when filling the timetable. */ Company *owner = Company::GetIfValid(v->owner); - uint rounding_factor = owner ? owner->settings.timetable_autofill_rounding : DAY_TICKS; + uint rounding_factor = owner ? owner->settings.timetable_autofill_rounding : 0; + if (rounding_factor == 0) rounding_factor = _settings_game.game_time.time_in_minutes ? _settings_game.game_time.ticks_per_minute : DAY_TICKS; uint time_to_set = CeilDiv(std::max(time_taken, 1U), rounding_factor) * rounding_factor; if (travel_field && (autofilling || !real_timetable_order->IsTravelTimetabled())) {