diff --git a/src/command.cpp b/src/command.cpp index 671a4ef29d..a0c3da57db 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -369,7 +369,7 @@ static const Command _command_proc_table[] = { DEF_CMD(CmdChangeTimetable, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_CHANGE_TIMETABLE DEF_CMD(CmdSetVehicleOnTime, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_SET_VEHICLE_ON_TIME DEF_CMD(CmdAutofillTimetable, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_AUTOFILL_TIMETABLE - DEF_CMD(CmdAutomateTimetable, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_AUTOMATE_TIMETABLE] + DEF_CMD(CmdAutomateTimetable, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_AUTOMATE_TIMETABLE DEF_CMD(CmdSetTimetableStart, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_SET_TIMETABLE_START DEF_CMD(CmdOpenCloseAirport, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_OPEN_CLOSE_AIRPORT diff --git a/src/lang/english.txt b/src/lang/english.txt index 721a23dfac..9cbb7a7bfb 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -4424,7 +4424,7 @@ 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_TOOLTIP :{BLACK}Manage the timetables automatically by updating the values for each journey (Ctrl+Click when disabling to keep the current timetable) STR_TIMETABLE_EXPECTED :{BLACK}Expected STR_TIMETABLE_SCHEDULED :{BLACK}Scheduled diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 9279306003..e3972351e3 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1220,7 +1220,7 @@ CommandCost CmdSkipToOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 InvalidateVehicleOrder(v, VIWD_MODIFY_ORDERS); - if (_settings_game.order.timetable_separation) v->ClearSeparation(); + v->ClearSeparation(); if (_settings_game.order.timetable_separation) ClrBit(v->vehicle_flags, VF_TIMETABLE_STARTED); } @@ -1716,7 +1716,7 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 SetBit(dst->vehicle_flags, VF_AUTOMATE_TIMETABLE); } - if (_settings_game.order.timetable_separation) dst->ClearSeparation(); + dst->ClearSeparation(); if (_settings_game.order.timetable_separation) ClrBit(dst->vehicle_flags, VF_TIMETABLE_STARTED); InvalidateVehicleOrder(dst, VIWD_REMOVE_ALL_ORDERS); diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index 4524fb74ba..b5e106150c 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -268,9 +268,9 @@ static int CDECL VehicleTimetableSorter(Vehicle * const *ap, Vehicle * const *bp * Set the start date of the timetable. * @param tile Not used. * @param flags Operation to perform. - * @param p2 Various bitstuffed elements - * - p2 = (bit 0-19) - Vehicle ID. - * - p2 = (bit 20) - Set to 1 to set timetable start for all vehicles sharing this order + * @param p1 Various bitstuffed elements + * - p1 = (bit 0-19) - Vehicle ID. + * - p1 = (bit 20) - Set to 1 to set timetable start for all vehicles sharing this order * @param p2 The timetable start date. * @param text Not used. * @return The error or cost of the operation. @@ -442,8 +442,8 @@ CommandCost CmdAutomateTimetable(TileIndex index, DoCommandFlag flags, uint32 p1 OrderList *orders = v2->orders.list; if (orders != NULL) { for (int i = 0; i < orders->GetNumOrders(); i++) { - ChangeTimetable(v2, i, 0, MTF_WAIT_TIME, true); - ChangeTimetable(v2, i, 0, MTF_TRAVEL_TIME, true); + ChangeTimetable(v2, i, 0, MTF_WAIT_TIME, false); + ChangeTimetable(v2, i, 0, MTF_TRAVEL_TIME, false); } } } @@ -603,7 +603,7 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling) /* Start automated timetables at first opportunity */ if (!HasBit(v->vehicle_flags, VF_TIMETABLE_STARTED) && HasBit(v->vehicle_flags, VF_AUTOMATE_TIMETABLE)) { - if (_settings_game.order.timetable_separation) v->ClearSeparation(); + v->ClearSeparation(); SetBit(v->vehicle_flags, VF_TIMETABLE_STARTED); v->lateness_counter = 0; if (_settings_game.order.timetable_separation) UpdateSeparationOrder(v); @@ -696,7 +696,7 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling) * Otherwise we risk trains blocking 1-lane stations for long times. */ ChangeTimetable(v, v->cur_real_order_index, 0, travelling ? MTF_TRAVEL_TIME : MTF_WAIT_TIME, true); for (Vehicle *v2 = v->FirstShared(); v2 != NULL; v2 = v2->NextShared()) { - if (_settings_game.order.timetable_separation) v2->ClearSeparation(); + v2->ClearSeparation(); ClrBit(v2->vehicle_flags, VF_TIMETABLE_STARTED); SetWindowDirty(WC_VEHICLE_TIMETABLE, v2->index); } diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index c163cb33ee..d9a3bba709 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -650,7 +650,7 @@ struct TimetableWindow : Window { case WID_VT_AUTOMATE: { uint32 p2 = 0; if (!HasBit(v->vehicle_flags, VF_AUTOMATE_TIMETABLE)) SetBit(p2, 0); - if (!_ctrl_pressed) SetBit(p2, 1); + if (_ctrl_pressed) SetBit(p2, 1); DoCommandP(0, v->index, p2, CMD_AUTOMATE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE)); break; } diff --git a/src/vehicle.cpp b/src/vehicle.cpp index f080b20923..38fcc3e695 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -265,8 +265,8 @@ uint Vehicle::Crash(bool flooded) v->MarkAllViewportsDirty(); } + this->ClearSeparation(); if (_settings_game.order.timetable_separation) { - this->ClearSeparation(); ClrBit(this->vehicle_flags, VF_TIMETABLE_STARTED); } @@ -2618,8 +2618,8 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command) if (flags & DC_EXEC) { if (!(this->current_order.GetDepotOrderType() & ODTFB_BREAKDOWN)) this->current_order.SetDepotOrderType(ODTF_MANUAL); this->current_order.SetDepotActionType(halt_in_depot ? ODATF_SERVICE_ONLY : ODATFB_HALT); + this->ClearSeparation(); if (_settings_game.order.timetable_separation) { - this->ClearSeparation(); ClrBit(this->vehicle_flags, VF_TIMETABLE_STARTED); } SetWindowWidgetDirty(WC_VEHICLE_VIEW, this->index, WID_VV_START_STOP); @@ -2642,8 +2642,8 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command) if (this->current_order.GetDepotOrderType() & ODTFB_BREAKDOWN) { this->current_order.SetDepotActionType(this->current_order.GetDepotActionType() == ODATFB_HALT ? ODATF_SERVICE_ONLY : ODATFB_HALT); } else { + this->ClearSeparation(); if (_settings_game.order.timetable_separation) { - this->ClearSeparation(); ClrBit(this->vehicle_flags, VF_TIMETABLE_STARTED); } @@ -3102,7 +3102,7 @@ void Vehicle::RemoveFromShared() this->next_shared = NULL; this->previous_shared = NULL; - if (_settings_game.order.timetable_separation) this->ClearSeparation(); + this->ClearSeparation(); if (_settings_game.order.timetable_separation) ClrBit(this->vehicle_flags, VF_TIMETABLE_STARTED); } diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 45f7f3d616..22a56274f4 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -606,7 +606,7 @@ CommandCost CmdStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, if (flags & DC_EXEC) { if (v->IsStoppedInDepot() && (flags & DC_AUTOREPLACE) == 0) DeleteVehicleNews(p1, STR_NEWS_TRAIN_IS_WAITING + v->type); - if (_settings_game.order.timetable_separation) v->ClearSeparation(); + v->ClearSeparation(); if (_settings_game.order.timetable_separation) ClrBit(v->vehicle_flags, VF_TIMETABLE_STARTED); v->vehstatus ^= VS_STOPPED;