MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OrderClick_NearestDepot

Method OrderClick_NearestDepot

src/order_gui.cpp:628–636  ·  view source on GitHub ↗

* Handle the click on the service in nearest depot button. */

Source from the content-addressed store, hash-verified

626 * Handle the click on the service in nearest depot button.
627 */
628 void OrderClick_NearestDepot()
629 {
630 Order order{};
631 order.MakeGoToDepot(DepotID::Invalid(), OrderDepotTypeFlag::PartOfOrders,
632 _settings_client.gui.new_nonstop && this->vehicle->IsGroundVehicle() ? OrderNonStopFlag::NoIntermediate : OrderNonStopFlags{});
633 order.SetDepotActionType(OrderDepotActionFlag::NearestDepot);
634
635 Command<CMD_INSERT_ORDER>::Post(STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), order);
636 }
637
638 /**
639 * Handle the click on the unload button.

Callers 2

OnDropdownSelectMethod · 0.95
OnHotkeyMethod · 0.95

Calls 5

OrderGetSelMethod · 0.95
InvalidFunction · 0.85
MakeGoToDepotMethod · 0.80
SetDepotActionTypeMethod · 0.80
IsGroundVehicleMethod · 0.45

Tested by

no test coverage detected