diff --git a/src/command_type.h b/src/command_type.h index fcf859ffb9..9aeeaf7f7e 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -325,7 +325,7 @@ enum Commands { CMD_CHANGE_TIMETABLE, ///< change the timetable for a vehicle CMD_SET_VEHICLE_ON_TIME, ///< set the vehicle on time feature (timetable) CMD_AUTOFILL_TIMETABLE, ///< autofill the timetable - CMD_AUTOMATE_TIMETABLE, ///< automate the timetable + CMD_AUTOMATE_TIMETABLE, ///< automate the timetable CMD_SET_TIMETABLE_START, ///< set the date that a timetable should start CMD_OPEN_CLOSE_AIRPORT, ///< open/close an airport to incoming aircraft diff --git a/src/lang/english.txt b/src/lang/english.txt index 7e3334e78b..3a0edf8138 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1398,12 +1398,12 @@ STR_CONFIG_SETTING_ADVANCED_VEHICLE_LISTS :Use groups in v STR_CONFIG_SETTING_ADVANCED_VEHICLE_LISTS_HELPTEXT :Enable usage of the advanced vehicle lists for grouping vehicles STR_CONFIG_SETTING_LOADING_INDICATORS :Use loading indicators: {STRING2} STR_CONFIG_SETTING_LOADING_INDICATORS_HELPTEXT :Select whether loading indicators are displayed above loading or unloading vehicles -STR_CONFIG_SETTING_TIMETABLE_AUTOMATED :{LTBLUE}Automatically manage timetables: {ORANGE}{STRING2} -STR_CONFIG_SETTING_TIMETABLE_AUTOMATED_HELPTEXT :Whether to enable automatic timetables +STR_CONFIG_SETTING_TIMETABLE_AUTOMATED :Automatically manage timetables: {STRING2} +STR_CONFIG_SETTING_TIMETABLE_AUTOMATED_HELPTEXT :Whether to enable automatic timetables STR_CONFIG_SETTING_TIMETABLE_IN_TICKS :Show timetable in ticks rather than days: {STRING2} STR_CONFIG_SETTING_TIMETABLE_IN_TICKS_HELPTEXT :Show travel times in time tables in game ticks instead of days -STR_CONFIG_SETTING_TIMETABLE_SEPARATION :{LTBLUE}Use timetable to ensure vehicle separation: {ORANGE}{STRING2} -STR_CONFIG_SETTING_TIMETABLE_SEPARATION_HELPTEXT :Select whether to ensure separation of vehicles when using automatic timetables +STR_CONFIG_SETTING_TIMETABLE_SEPARATION :Use timetable to ensure vehicle separation: {STRING2} +STR_CONFIG_SETTING_TIMETABLE_SEPARATION_HELPTEXT :Select whether to ensure separation of vehicles when using automatic timetables 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_QUICKGOTO :Quick creation of vehicle orders: {STRING2} @@ -3941,8 +3941,8 @@ STR_TIMETABLE_RESET_LATENESS_TOOLTIP :{BLACK}Reset th STR_TIMETABLE_AUTOFILL :{BLACK}Autofill STR_TIMETABLE_AUTOFILL_TOOLTIP :{BLACK}Fill the timetable automatically with the values from the next journey (Ctrl+Click to try to keep waiting times) -STR_TIMETABLE_AUTOMATE :{BLACK}Automate -STR_TIMETABLE_AUTOMATE_TOOLTIP :{BLACK}Manage the timetables automatically by updating the values for each journey +STR_TIMETABLE_AUTOMATE :{BLACK}Automate +STR_TIMETABLE_AUTOMATE_TOOLTIP :{BLACK}Manage the timetables automatically by updating the values for each journey STR_TIMETABLE_EXPECTED :{BLACK}Expected STR_TIMETABLE_SCHEDULED :{BLACK}Scheduled diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 1781b7b876..8bfbc1469b 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1622,9 +1622,10 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /* Set automation bit if target has it. */ - if (HasBit(src->vehicle_flags, VF_AUTOMATE_TIMETABLE)) + if (HasBit(src->vehicle_flags, VF_AUTOMATE_TIMETABLE)) { SetBit(dst->vehicle_flags, VF_AUTOMATE_TIMETABLE); - + } + if (_settings_game.order.timetable_separation) dst->ClearSeparation(); if (_settings_game.order.timetable_separation) ClrBit(dst->vehicle_flags, VF_TIMETABLE_STARTED); diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp index ddb2eef215..2a9179110d 100644 --- a/src/saveload/vehicle_sl.cpp +++ b/src/saveload/vehicle_sl.cpp @@ -693,7 +693,7 @@ const SaveLoad *GetVehicleDescription(VehicleType vt) SLE_CONDVAR(Vehicle, waiting_triggers, SLE_UINT8, 2, SL_MAX_VERSION), SLE_CONDREF(Vehicle, ahead_separation, REF_VEHICLE, TIMESEP_SV, SL_MAX_VERSION), - SLE_CONDREF(Vehicle, behind_separation, REF_VEHICLE, TIMESEP_SV, SL_MAX_VERSION), + SLE_CONDREF(Vehicle, behind_separation, REF_VEHICLE, TIMESEP_SV, SL_MAX_VERSION), SLE_CONDREF(Vehicle, next_shared, REF_VEHICLE, 2, SL_MAX_VERSION), SLE_CONDNULL(2, 2, 68), @@ -702,7 +702,7 @@ const SaveLoad *GetVehicleDescription(VehicleType vt) SLE_CONDVAR(Vehicle, group_id, SLE_UINT16, 60, SL_MAX_VERSION), SLE_CONDVAR(Vehicle, current_order_time, SLE_UINT32, 67, SL_MAX_VERSION), - SLE_CONDVAR(Vehicle, current_loading_time, SLE_UINT32, TIMESEP_SV, SL_MAX_VERSION), + SLE_CONDVAR(Vehicle, current_loading_time, SLE_UINT32, TIMESEP_SV, SL_MAX_VERSION), SLE_CONDVAR(Vehicle, lateness_counter, SLE_INT32, 67, SL_MAX_VERSION), SLE_CONDNULL(10, 2, 143), // old reserved space diff --git a/src/settings_type.h b/src/settings_type.h index e7d03a3656..57eae521f7 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -438,8 +438,8 @@ struct OrderSettings { bool gradual_loading; ///< load vehicles gradually bool selectgoods; ///< only send the goods to station if a train has been there bool no_servicing_if_no_breakdowns; ///< don't send vehicles to depot when breakdowns are disabled - bool timetable_automated; ///< whether to automatically manage timetables - bool timetable_separation; ///< whether to perform automatic separation based on timetable + bool timetable_automated; ///< whether to automatically manage timetables + bool timetable_separation; ///< whether to perform automatic separation based on timetable bool serviceathelipad; ///< service helicopters at helipads automatically (no need to send to depot) }; diff --git a/src/strings_func.h b/src/strings_func.h index 486cd4ff8d..2c7809d020 100644 --- a/src/strings_func.h +++ b/src/strings_func.h @@ -56,8 +56,7 @@ public: offset(0), num_param(size) { - uint left = parent.GetDataLeft(); - assert(size <= left); + assert(size <= parent.GetDataLeft()); if (parent.type == NULL) { this->type = NULL; } else { diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index 19dbdd5eef..eb897400ac 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -373,7 +373,7 @@ CommandCost CmdAutomateTimetable(TileIndex index, DoCommandFlag flags, uint32 p1 if (!_settings_game.order.timetable_automated) return CMD_ERROR; VehicleID veh = GB(p1, 0, 16); - + Vehicle *v = Vehicle::GetIfValid(veh); if (v == NULL || !v->IsPrimaryVehicle()) return CMD_ERROR; @@ -642,7 +642,7 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling) } return; } - + if (new_time < 1) new_time = 1; if (new_time != (int32)timetabled) ChangeTimetable(v, v->cur_real_order_index, new_time, travelling ? MTF_TRAVEL_TIME : MTF_WAIT_TIME, true); diff --git a/src/vehicle.cpp b/src/vehicle.cpp index ac1b42c5af..fe09d245e6 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2142,8 +2142,9 @@ void Vehicle::HandleLoading(bool mode) uint wait_time = max(this->current_order.GetTimetabledWait() - this->lateness_counter, 0); /* Save time just loading took since that is what goes into the timetable */ - if (!HasBit(this->vehicle_flags, VF_LOADING_FINISHED)) - this->current_loading_time = this->current_order_time; + if (!HasBit(this->vehicle_flags, VF_LOADING_FINISHED)) { + this->current_loading_time = this->current_order_time; + } /* Not the first call for this tick, or still loading */ if (mode || !HasBit(this->vehicle_flags, VF_LOADING_FINISHED) || this->current_order_time < wait_time) return; diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 6bcca05e9b..0b291be2d6 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -46,11 +46,11 @@ enum VehicleFlags { VF_TIMETABLE_STARTED, ///< Whether the vehicle has started running on the timetable yet. VF_AUTOFILL_TIMETABLE, ///< Whether the vehicle should fill in the timetable automatically. VF_AUTOFILL_PRES_WAIT_TIME, ///< Whether non-destructive auto-fill should preserve waiting times - VF_AUTOMATE_TIMETABLE, ///< Whether the vehicle should manage the timetable automatically. VF_STOP_LOADING, ///< Don't load anymore during the next load cycle. VF_PATHFINDER_LOST, ///< Vehicle's pathfinder is lost. VF_SERVINT_IS_CUSTOM, ///< Service interval is custom. VF_SERVINT_IS_PERCENT, ///< Service interval is percent. + VF_AUTOMATE_TIMETABLE, ///< Whether the vehicle should manage the timetable automatically. }; /** Bit numbers used to indicate which of the #NewGRFCache values are valid. */ @@ -191,7 +191,7 @@ public: /* Used for timetabling. */ uint32 current_order_time; ///< How many ticks have passed since this order started. - uint32 current_loading_time; ///< How long loading took. Less than current_order_time if vehicle is early. + uint32 current_loading_time; ///< How long loading took. Less than current_order_time if vehicle is early. int32 lateness_counter; ///< How many ticks late (or early if negative) this vehicle is. Date timetable_start; ///< When the vehicle is supposed to start the timetable.