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

Method OrderGetSel

src/order_gui.cpp:550–554  ·  view source on GitHub ↗

* Return the memorised selected order. * @return the memorised order if it is a valid one * else return the number of orders */

Source from the content-addressed store, hash-verified

548 * else return the number of orders
549 */
550 VehicleOrderID OrderGetSel() const
551 {
552 int num = this->selected_order;
553 return (num >= 0 && num < vehicle->GetNumOrders()) ? num : vehicle->GetNumOrders();
554 }
555
556 /**
557 * Calculate the selected order.

Callers 15

OrderClick_FullLoadMethod · 0.95
OrderClick_ServiceMethod · 0.95
OrderClick_UnloadMethod · 0.95
OrderClick_NonstopMethod · 0.95
OrderClick_SkipMethod · 0.95
OrderClick_DeleteMethod · 0.95
OrderClick_RefitMethod · 0.95
UpdateButtonStateMethod · 0.95
GetWidgetStringMethod · 0.95
OnClickMethod · 0.95
OnQueryTextFinishedMethod · 0.95

Calls 1

GetNumOrdersMethod · 0.45

Tested by

no test coverage detected