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

Method OrderClick_Skip

src/order_gui.cpp:690–698  ·  view source on GitHub ↗

* Handle the click on the skip button. * If ctrl is pressed, skip to selected order, else skip to current order + 1 */

Source from the content-addressed store, hash-verified

688 * If ctrl is pressed, skip to selected order, else skip to current order + 1
689 */
690 void OrderClick_Skip()
691 {
692 /* Don't skip when there's nothing to skip */
693 if (_ctrl_pressed && this->vehicle->cur_implicit_order_index == this->OrderGetSel()) return;
694 if (this->vehicle->GetNumOrders() <= 1) return;
695
696 Command<CMD_SKIP_TO_ORDER>::Post(_ctrl_pressed ? STR_ERROR_CAN_T_SKIP_TO_ORDER : STR_ERROR_CAN_T_SKIP_ORDER,
697 this->vehicle->tile, this->vehicle->index, _ctrl_pressed ? this->OrderGetSel() : ((this->vehicle->cur_implicit_order_index + 1) % this->vehicle->GetNumOrders()));
698 }
699
700 /**
701 * Handle the click on the delete button.

Callers 2

OnClickMethod · 0.95
OnHotkeyMethod · 0.95

Calls 2

OrderGetSelMethod · 0.95
GetNumOrdersMethod · 0.45

Tested by

no test coverage detected