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

Method OnPlaceObject

src/order_gui.cpp:1444–1455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1442 }
1443
1444 void OnPlaceObject([[maybe_unused]] Point pt, TileIndex tile) override
1445 {
1446 if (this->goto_type == OPOS_GOTO) {
1447 const Order cmd = GetOrderCmdFromTile(this->vehicle, tile);
1448 if (cmd.IsType(OT_NOTHING)) return;
1449
1450 if (Command<CMD_INSERT_ORDER>::Post(STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), cmd)) {
1451 /* With quick goto the Go To button stays active */
1452 if (!_settings_client.gui.quick_goto) ResetObjectToPlace();
1453 }
1454 }
1455 }
1456
1457 bool OnVehicleSelect(const Vehicle *v) override
1458 {

Callers

nothing calls this directly

Calls 4

OrderGetSelMethod · 0.95
GetOrderCmdFromTileFunction · 0.85
ResetObjectToPlaceFunction · 0.85
IsTypeMethod · 0.80

Tested by

no test coverage detected