From fc3b81a313fa4ea7b4ad381ed8825c9690ef19d0 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Tue, 24 Mar 2026 08:52:50 -0400 Subject: [PATCH] Codechange: Rename "non-stop" and "go via" order flags for clarity (#15398) --- src/order_base.h | 4 ++-- src/order_cmd.cpp | 16 ++++++++-------- src/order_gui.cpp | 34 ++++++++++++++++----------------- src/order_type.h | 4 ++-- src/roadveh_cmd.cpp | 2 +- src/saveload/afterload.cpp | 2 +- src/saveload/order_sl.cpp | 4 ++-- src/script/api/script_order.cpp | 2 +- src/timetable_cmd.cpp | 2 +- src/timetable_gui.cpp | 4 ++-- src/train_cmd.cpp | 4 ++-- src/vehicle.cpp | 2 +- 12 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/order_base.h b/src/order_base.h index 2fe25a2c3a..01c50d0804 100644 --- a/src/order_base.h +++ b/src/order_base.h @@ -75,7 +75,7 @@ public: void Free(); void MakeGoToStation(StationID destination); - void MakeGoToDepot(DestinationID destination, OrderDepotTypeFlags order, OrderNonStopFlags non_stop_type = OrderNonStopFlag::NoIntermediate, OrderDepotActionFlags action = {}, CargoType cargo = CARGO_NO_REFIT); + void MakeGoToDepot(DestinationID destination, OrderDepotTypeFlags order, OrderNonStopFlags non_stop_type = OrderNonStopFlag::NonStop, OrderDepotActionFlags action = {}, CargoType cargo = CARGO_NO_REFIT); void MakeGoToWaypoint(StationID destination); void MakeLoading(bool ordered); void MakeLeaveStation(); @@ -351,7 +351,7 @@ public: { if (!this->IsTravelTimetabled() && !this->IsType(OT_CONDITIONAL)) return false; if (!this->IsWaitTimetabled() && this->IsType(OT_GOTO_STATION) && - !this->GetNonStopType().Test(OrderNonStopFlag::NoDestination)) { + !this->GetNonStopType().Test(OrderNonStopFlag::GoVia)) { return false; } return true; diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 520991c2a2..51baa13d83 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -184,7 +184,7 @@ uint16_t Order::MapOldOrder() const case OT_GOTO_STATION: if (this->GetUnloadType() == OrderUnloadType::Unload) SetBit(order, 5); if (this->IsFullLoadOrder()) SetBit(order, 6); - if (this->GetNonStopType().Test(OrderNonStopFlag::NoIntermediate)) SetBit(order, 7); + if (this->GetNonStopType().Test(OrderNonStopFlag::NonStop)) SetBit(order, 7); order |= GB(this->GetDestination().value, 0, 8) << 8; break; case OT_GOTO_DEPOT: @@ -1215,7 +1215,7 @@ CommandCost CmdModifyOrder(DoCommandFlags flags, VehicleID veh, VehicleOrderID s if (nonstop_flags == order->GetNonStopType()) return CMD_ERROR; /* Test for invalid flags. */ - nonstop_flags.Reset({OrderNonStopFlag::NoIntermediate, OrderNonStopFlag::NoDestination}); + nonstop_flags.Reset({OrderNonStopFlag::NonStop, OrderNonStopFlag::GoVia}); if (nonstop_flags.Any()) return CMD_ERROR; break; } @@ -1226,7 +1226,7 @@ CommandCost CmdModifyOrder(DoCommandFlags flags, VehicleID veh, VehicleOrderID s break; case MOF_UNLOAD: { - if (order->GetNonStopType().Test(OrderNonStopFlag::NoDestination)) return CMD_ERROR; + if (order->GetNonStopType().Test(OrderNonStopFlag::GoVia)) return CMD_ERROR; OrderUnloadType unload_type = static_cast(data); if (unload_type == order->GetUnloadType()) return CMD_ERROR; @@ -1245,7 +1245,7 @@ CommandCost CmdModifyOrder(DoCommandFlags flags, VehicleID veh, VehicleOrderID s } case MOF_LOAD: { - if (order->GetNonStopType().Test(OrderNonStopFlag::NoDestination)) return CMD_ERROR; + if (order->GetNonStopType().Test(OrderNonStopFlag::GoVia)) return CMD_ERROR; OrderLoadType load_type = static_cast(data); if (load_type == order->GetLoadType()) return CMD_ERROR; @@ -1330,7 +1330,7 @@ CommandCost CmdModifyOrder(DoCommandFlags flags, VehicleID veh, VehicleOrderID s switch (mof) { case MOF_NON_STOP: order->SetNonStopType(static_cast(data)); - if (order->GetNonStopType().Test(OrderNonStopFlag::NoDestination)) { + if (order->GetNonStopType().Test(OrderNonStopFlag::GoVia)) { order->SetRefit(CARGO_NO_REFIT); order->SetLoadType(OrderLoadType::LoadIfPossible); order->SetUnloadType(OrderUnloadType::UnloadIfPossible); @@ -2107,7 +2107,7 @@ bool ProcessOrders(Vehicle *v) bool may_reverse = v->current_order.IsType(OT_NOTHING); /* Check if we've reached a 'via' destination. */ - if (((v->current_order.IsType(OT_GOTO_STATION) && v->current_order.GetNonStopType().Test(OrderNonStopFlag::NoDestination)) || v->current_order.IsType(OT_GOTO_WAYPOINT)) && + if (((v->current_order.IsType(OT_GOTO_STATION) && v->current_order.GetNonStopType().Test(OrderNonStopFlag::GoVia)) || v->current_order.IsType(OT_GOTO_WAYPOINT)) && IsTileType(v->tile, TileType::Station) && v->current_order.GetDestination() == GetStationIndex(v->tile)) { v->DeleteUnreachedImplicitOrders(); @@ -2184,13 +2184,13 @@ bool Order::ShouldStopAtStation(const Vehicle *v, StationID station) const return (!this->IsType(OT_GOTO_DEPOT) || this->GetDepotOrderType().Test(OrderDepotTypeFlag::PartOfOrders)) && v->last_station_visited != station && // Do stop only when we've not just been there /* Finally do stop when there is no non-stop flag set for this type of station. */ - !this->GetNonStopType().Test(is_dest_station ? OrderNonStopFlag::NoDestination : OrderNonStopFlag::NoIntermediate); + !this->GetNonStopType().Test(is_dest_station ? OrderNonStopFlag::GoVia : OrderNonStopFlag::NonStop); } bool Order::CanLoadOrUnload() const { return (this->IsType(OT_GOTO_STATION) || this->IsType(OT_IMPLICIT)) && - !this->GetNonStopType().Test(OrderNonStopFlag::NoDestination) && + !this->GetNonStopType().Test(OrderNonStopFlag::GoVia) && (this->GetLoadType() != OrderLoadType::NoLoad || this->GetUnloadType() != OrderUnloadType::NoUnload); } diff --git a/src/order_gui.cpp b/src/order_gui.cpp index ac32f9a7b7..eb929cebb4 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -202,9 +202,9 @@ static const StringID _order_refit_action_dropdown[] = { static StringID GetOrderGoToString(const Order &order) { if (order.GetDepotOrderType().Test(OrderDepotTypeFlag::Service)) { - return order.GetNonStopType().Test(OrderNonStopFlag::NoIntermediate) ? STR_ORDER_SERVICE_NON_STOP_AT : STR_ORDER_SERVICE_AT; + return order.GetNonStopType().Test(OrderNonStopFlag::NonStop) ? STR_ORDER_SERVICE_NON_STOP_AT : STR_ORDER_SERVICE_AT; } else { - return order.GetNonStopType().Test(OrderNonStopFlag::NoIntermediate) ? STR_ORDER_GO_NON_STOP_TO : STR_ORDER_GO_TO; + return order.GetNonStopType().Test(OrderNonStopFlag::NonStop) ? STR_ORDER_GO_NON_STOP_TO : STR_ORDER_GO_TO; } } @@ -270,7 +270,7 @@ void DrawOrderString(const Vehicle *v, const Order *order, VehicleOrderID order_ } } else { /* Show non-stop, refit and stop location only in the order window. */ - if (!order->GetNonStopType().Test(OrderNonStopFlag::NoDestination)) { + if (!order->GetNonStopType().Test(OrderNonStopFlag::GoVia)) { StringID str = _station_load_types[order->IsRefit()][to_underlying(unload)][to_underlying(load)]; if (str != INVALID_STRING_ID) { if (order->IsRefit()) { @@ -281,7 +281,7 @@ void DrawOrderString(const Vehicle *v, const Order *order, VehicleOrderID order_ } } - if (v->type == VEH_TRAIN && !order->GetNonStopType().Test(OrderNonStopFlag::NoDestination)) { + if (v->type == VEH_TRAIN && !order->GetNonStopType().Test(OrderNonStopFlag::GoVia)) { /* Only show the stopping location if other than the default chosen by the player. */ if (order->GetStopLocation() != _settings_client.gui.stop_location) { line += GetString(STR_ORDER_STOP_LOCATION_NEAR_END + to_underlying(order->GetStopLocation())); @@ -320,7 +320,7 @@ void DrawOrderString(const Vehicle *v, const Order *order, VehicleOrderID order_ break; case OT_GOTO_WAYPOINT: - line = GetString(order->GetNonStopType().Test(OrderNonStopFlag::NoIntermediate) ? STR_ORDER_GO_NON_STOP_TO_WAYPOINT : STR_ORDER_GO_TO_WAYPOINT, order->GetDestination()); + line = GetString(order->GetNonStopType().Test(OrderNonStopFlag::NonStop) ? STR_ORDER_GO_NON_STOP_TO_WAYPOINT : STR_ORDER_GO_TO_WAYPOINT, order->GetDestination()); break; case OT_CONDITIONAL: @@ -372,7 +372,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) if (IsDepotTypeTile(tile, (TransportType)(uint)v->type) && IsTileOwner(tile, _local_company)) { order.MakeGoToDepot(GetDepotDestinationIndex(tile), OrderDepotTypeFlag::PartOfOrders, - (_settings_client.gui.new_nonstop && v->IsGroundVehicle()) ? OrderNonStopFlag::NoIntermediate : OrderNonStopFlags{}); + (_settings_client.gui.new_nonstop && v->IsGroundVehicle()) ? OrderNonStopFlag::NonStop : OrderNonStopFlags{}); if (_ctrl_pressed) { /* Now we are allowed to set the action type. */ @@ -387,7 +387,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) v->type == VEH_TRAIN && IsTileOwner(tile, _local_company)) { order.MakeGoToWaypoint(GetStationIndex(tile)); - if (_settings_client.gui.new_nonstop != _ctrl_pressed) order.SetNonStopType({OrderNonStopFlag::NoIntermediate, OrderNonStopFlag::NoDestination}); + if (_settings_client.gui.new_nonstop != _ctrl_pressed) order.SetNonStopType({OrderNonStopFlag::NonStop, OrderNonStopFlag::GoVia}); return order; } @@ -396,7 +396,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) v->type == VEH_ROAD && IsTileOwner(tile, _local_company)) { order.MakeGoToWaypoint(GetStationIndex(tile)); - if (_settings_client.gui.new_nonstop != _ctrl_pressed) order.SetNonStopType({OrderNonStopFlag::NoIntermediate, OrderNonStopFlag::NoDestination}); + if (_settings_client.gui.new_nonstop != _ctrl_pressed) order.SetNonStopType({OrderNonStopFlag::NonStop, OrderNonStopFlag::GoVia}); return order; } @@ -428,7 +428,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) if (st->facilities.Any(facil)) { order.MakeGoToStation(st->index); if (_ctrl_pressed) order.SetLoadType(OrderLoadType::FullLoadAny); - if (_settings_client.gui.new_nonstop && v->IsGroundVehicle()) order.SetNonStopType(OrderNonStopFlag::NoIntermediate); + if (_settings_client.gui.new_nonstop && v->IsGroundVehicle()) order.SetNonStopType(OrderNonStopFlag::NonStop); order.SetStopLocation(v->type == VEH_TRAIN ? (OrderStopLocation)(_settings_client.gui.stop_location) : OrderStopLocation::FarEnd); return order; } @@ -631,7 +631,7 @@ private: { Order order{}; order.MakeGoToDepot(DepotID::Invalid(), OrderDepotTypeFlag::PartOfOrders, - _settings_client.gui.new_nonstop && this->vehicle->IsGroundVehicle() ? OrderNonStopFlag::NoIntermediate : OrderNonStopFlags{}); + _settings_client.gui.new_nonstop && this->vehicle->IsGroundVehicle() ? OrderNonStopFlag::NonStop : OrderNonStopFlags{}); order.SetDepotActionType(OrderDepotActionFlag::NearestDepot); Command::Post(STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), order); @@ -678,7 +678,7 @@ private: /* Keypress if no value, so 'toggle' to the next */ if (!non_stop.has_value()) { - non_stop = order->GetNonStopType().Flip(OrderNonStopFlag::NoIntermediate); + non_stop = order->GetNonStopType().Flip(OrderNonStopFlag::NonStop); } this->SetWidgetDirty(WID_O_NON_STOP); @@ -968,8 +968,8 @@ public: this->DisableWidget(WID_O_UNLOAD); this->DisableWidget(WID_O_REFIT_DROPDOWN); } else { - this->SetWidgetDisabledState(WID_O_FULL_LOAD, order->GetNonStopType().Test(OrderNonStopFlag::NoDestination)); // full load - this->SetWidgetDisabledState(WID_O_UNLOAD, order->GetNonStopType().Test(OrderNonStopFlag::NoDestination)); // unload + this->SetWidgetDisabledState(WID_O_FULL_LOAD, order->GetNonStopType().Test(OrderNonStopFlag::GoVia)); // full load + this->SetWidgetDisabledState(WID_O_UNLOAD, order->GetNonStopType().Test(OrderNonStopFlag::GoVia)); // unload switch (order->GetType()) { case OT_GOTO_STATION: @@ -981,7 +981,7 @@ public: middle_sel->SetDisplayedPlane(DP_MIDDLE_UNLOAD); right_sel->SetDisplayedPlane(DP_RIGHT_REFIT); this->EnableWidget(WID_O_NON_STOP); - this->SetWidgetLoweredState(WID_O_NON_STOP, order->GetNonStopType().Test(OrderNonStopFlag::NoIntermediate)); + this->SetWidgetLoweredState(WID_O_NON_STOP, order->GetNonStopType().Test(OrderNonStopFlag::NonStop)); } this->SetWidgetLoweredState(WID_O_FULL_LOAD, order->GetLoadType() == OrderLoadType::FullLoadAny); this->SetWidgetLoweredState(WID_O_UNLOAD, order->GetUnloadType() == OrderUnloadType::Unload); @@ -989,7 +989,7 @@ public: /* Can only do refitting when stopping at the destination and loading cargo. * Also enable the button if a refit is already set to allow clearing it. */ this->SetWidgetDisabledState(WID_O_REFIT_DROPDOWN, - order->GetLoadType() == OrderLoadType::NoLoad || order->GetNonStopType().Test(OrderNonStopFlag::NoDestination) || + order->GetLoadType() == OrderLoadType::NoLoad || order->GetNonStopType().Test(OrderNonStopFlag::GoVia) || ((!this->can_do_refit || !this->can_do_autorefit) && !order->IsRefit())); break; @@ -1003,7 +1003,7 @@ public: middle_sel->SetDisplayedPlane(DP_MIDDLE_UNLOAD); right_sel->SetDisplayedPlane(DP_RIGHT_EMPTY); this->EnableWidget(WID_O_NON_STOP); - this->SetWidgetLoweredState(WID_O_NON_STOP, order->GetNonStopType().Test(OrderNonStopFlag::NoIntermediate)); + this->SetWidgetLoweredState(WID_O_NON_STOP, order->GetNonStopType().Test(OrderNonStopFlag::NonStop)); } this->DisableWidget(WID_O_FULL_LOAD); this->DisableWidget(WID_O_UNLOAD); @@ -1019,7 +1019,7 @@ public: middle_sel->SetDisplayedPlane(DP_MIDDLE_SERVICE); right_sel->SetDisplayedPlane(DP_RIGHT_EMPTY); this->EnableWidget(WID_O_NON_STOP); - this->SetWidgetLoweredState(WID_O_NON_STOP, order->GetNonStopType().Test(OrderNonStopFlag::NoIntermediate)); + this->SetWidgetLoweredState(WID_O_NON_STOP, order->GetNonStopType().Test(OrderNonStopFlag::NonStop)); } /* Disable refit button if the order is no 'always go' order. * However, keep the service button enabled for refit-orders to allow clearing refits (without knowing about ctrl). */ diff --git a/src/order_type.h b/src/order_type.h index 5a07e8a208..aa25719397 100644 --- a/src/order_type.h +++ b/src/order_type.h @@ -85,8 +85,8 @@ enum class OrderLoadType : uint8_t { * Non-stop order flags. */ enum class OrderNonStopFlag : uint8_t { - NoIntermediate = 0, ///< The vehicle will not stop at any stations it passes except the destination, aka non-stop. - NoDestination = 1, ///< The vehicle will stop at any station it passes except the destination, aka via. + NonStop = 0, ///< The vehicle will not stop at any stations it passes except the destination, aka non-stop. + GoVia = 1, ///< The vehicle will stop at any station it passes except the destination, aka via. }; using OrderNonStopFlags = EnumBitSet; diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 87aaa0610e..341ee05b3b 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1704,7 +1704,7 @@ static void CheckIfRoadVehNeedsService(RoadVehicle *v) DepotID depot = GetDepotIndex(rfdd.tile); if (v->current_order.IsType(OT_GOTO_DEPOT) && - v->current_order.GetNonStopType().Test(OrderNonStopFlag::NoIntermediate) && + v->current_order.GetNonStopType().Test(OrderNonStopFlag::NonStop) && !Chance16(1, 20)) { return; } diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 7d9bd57d4a..f08eb42bf4 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -1827,7 +1827,7 @@ bool AfterLoadGame() v->current_order.ConvertFromOldSavegame(); if (v->type == VEH_ROAD && v->IsPrimaryVehicle() && v->FirstShared() == v) { - for (Order &order : v->Orders()) order.SetNonStopType(OrderNonStopFlag::NoIntermediate); + for (Order &order : v->Orders()) order.SetNonStopType(OrderNonStopFlag::NonStop); } } } else if (IsSavegameVersionBefore(SLV_94)) { diff --git a/src/saveload/order_sl.cpp b/src/saveload/order_sl.cpp index 0d7add142d..cac50ec853 100644 --- a/src/saveload/order_sl.cpp +++ b/src/saveload/order_sl.cpp @@ -31,9 +31,9 @@ void Order::ConvertFromOldSavegame() /* First handle non-stop - use value from savegame if possible, else use value from config file */ if (_settings_client.gui.sg_new_nonstop || (IsSavegameVersionBefore(SLV_22) && _savegame_type != SGT_TTO && _savegame_type != SGT_TTD && _settings_client.gui.new_nonstop)) { /* OFB_NON_STOP */ - this->SetNonStopType((old_flags & 8) ? OrderNonStopFlags{OrderNonStopFlag::NoIntermediate, OrderNonStopFlag::NoDestination} : OrderNonStopFlag::NoIntermediate); + this->SetNonStopType((old_flags & 8) ? OrderNonStopFlags{OrderNonStopFlag::NonStop, OrderNonStopFlag::GoVia} : OrderNonStopFlag::NonStop); } else { - this->SetNonStopType((old_flags & 8) ? OrderNonStopFlag::NoIntermediate : OrderNonStopFlags{}); + this->SetNonStopType((old_flags & 8) ? OrderNonStopFlag::NonStop : OrderNonStopFlags{}); } switch (this->GetType()) { diff --git a/src/script/api/script_order.cpp b/src/script/api/script_order.cpp index 8a9cd370d4..cc65dd3aae 100644 --- a/src/script/api/script_order.cpp +++ b/src/script/api/script_order.cpp @@ -492,7 +492,7 @@ static ScriptOrder::OrderPosition RealOrderPositionToScriptOrderPosition(Vehicle if ((order_flags & OF_GOTO_NEAREST_DEPOT) != 0) odaf.Set(OrderDepotActionFlag::NearestDepot); OrderNonStopFlags onsf{}; - if ((order_flags & OF_NON_STOP_INTERMEDIATE) != 0) onsf.Set(OrderNonStopFlag::NoIntermediate); + if ((order_flags & OF_NON_STOP_INTERMEDIATE) != 0) onsf.Set(OrderNonStopFlag::NonStop); if ((order_flags & OF_GOTO_NEAREST_DEPOT) != 0) { order.MakeGoToDepot(DepotID::Invalid(), odtf, onsf, odaf); } else { diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index c56081ba87..f4020e81b3 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -167,7 +167,7 @@ CommandCost CmdChangeTimetable(DoCommandFlags flags, VehicleID veh, VehicleOrder if (wait_time != order->GetWaitTime()) { switch (order->GetType()) { case OT_GOTO_STATION: - if (order->GetNonStopType().Test(OrderNonStopFlag::NoDestination)) return CommandCost(STR_ERROR_TIMETABLE_NOT_STOPPING_HERE); + if (order->GetNonStopType().Test(OrderNonStopFlag::GoVia)) return CommandCost(STR_ERROR_TIMETABLE_NOT_STOPPING_HERE); break; case OT_CONDITIONAL: diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index f7b3a34ecd..b166eb161e 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -110,7 +110,7 @@ static bool CanDetermineTimeTaken(const Order &order, bool travelling) if (travelling && !order.IsTravelTimetabled()) return false; /* No wait time but we are loading at this timetabled station */ if (!travelling && !order.IsWaitTimetabled() && order.IsType(OT_GOTO_STATION) && - !order.GetNonStopType().Test(OrderNonStopFlag::NoDestination)) { + !order.GetNonStopType().Test(OrderNonStopFlag::GoVia)) { return false; } @@ -348,7 +348,7 @@ struct TimetableWindow : Window { if (selected % 2 != 0) { disable = order != nullptr && (order->IsType(OT_CONDITIONAL) || order->IsType(OT_IMPLICIT)); } else { - disable = order == nullptr || ((!order->IsType(OT_GOTO_STATION) || order->GetNonStopType().Test(OrderNonStopFlag::NoDestination)) && !order->IsType(OT_CONDITIONAL)); + disable = order == nullptr || ((!order->IsType(OT_GOTO_STATION) || order->GetNonStopType().Test(OrderNonStopFlag::GoVia)) && !order->IsType(OT_CONDITIONAL)); } } bool disable_speed = disable || selected % 2 == 0 || v->type == VEH_AIRCRAFT; diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 45e2e8fad1..ba84db025e 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -4073,7 +4073,7 @@ static bool TrainLocoHandler(Train *v, bool mode) OrderType order_type = v->current_order.GetType(); /* Do not skip waypoints (incl. 'via' stations) when passing through at full speed. */ if ((order_type == OT_GOTO_WAYPOINT || order_type == OT_GOTO_STATION) && - v->current_order.GetNonStopType().Test(OrderNonStopFlag::NoDestination) && + v->current_order.GetNonStopType().Test(OrderNonStopFlag::GoVia) && IsTileType(v->tile, TileType::Station) && v->current_order.GetDestination() == GetStationIndex(v->tile)) { ProcessOrders(v); @@ -4183,7 +4183,7 @@ static void CheckIfTrainNeedsService(Train *v) } SetBit(v->gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS); - v->current_order.MakeGoToDepot(depot, OrderDepotTypeFlag::Service, OrderNonStopFlag::NoIntermediate, OrderDepotActionFlag::NearestDepot); + v->current_order.MakeGoToDepot(depot, OrderDepotTypeFlag::Service, OrderNonStopFlag::NonStop, OrderDepotActionFlag::NearestDepot); v->dest_tile = tfdd.tile; SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); } diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 8681f34622..bcb22bd881 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2239,7 +2239,7 @@ void Vehicle::BeginLoading() * necessary to be known for HandleTrainLoading to determine * whether the train is lost or not; not marking a train lost * that arrives at random stations is bad. */ - this->current_order.SetNonStopType({OrderNonStopFlag::NoIntermediate, OrderNonStopFlag::NoDestination}); + this->current_order.SetNonStopType({OrderNonStopFlag::NonStop, OrderNonStopFlag::GoVia}); } else { /* We weren't scheduled to stop here. Insert an implicit order