OpenTTD Source: src/roadveh_cmd.h File Reference

OpenTTD Source 13.1

Functions
roadveh_cmd.h File Reference
`#include "command_type.h"`
`#include "engine_type.h"`
`#include "vehicle_type.h"`

Go to the source code of this file.

## Functions
bool | RoadVehLeaveDepot (RoadVehicle *v, bool first)
CommandCost | CmdBuildRoadVehicle (DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **v)
| Build a road vehicle. More...
CommandCost | CmdTurnRoadVeh (DoCommandFlag flags, VehicleID veh_id)
| Turn a roadvehicle around. More...

## Detailed Description

Command definitions related to road vehicles.

Definition in file roadveh_cmd.h.

## Function Documentation

## ◆ CmdBuildRoadVehicle()

CommandCost CmdBuildRoadVehicle | ( | DoCommandFlag | flags,
|  | TileIndex | tile,
|  | const Engine * | e,
|  | Vehicle ** | ret
| ) |  |

Build a road vehicle.

Parameters

  | flags | type of operation.
  | tile | tile of the depot where road vehicle is built.
  | e | the engine to build.
  [out] | ret | the vehicle that has been built.

Returns
  the cost of this operation or an error.

Definition at line 260 of file roadveh_cmd.cpp.

References _current_company, DC_EXEC, DiagDirToDir(), Vehicle::direction, GetRoadDepotDirection(), GetRoadTypeInfo(), HasTileAnyRoadType(), Vehicle::owner, RoadTypeInfo::powered_roadtypes, return_cmd_error, RoadVehicleInfo::roadtype, and Vehicle::tile.

## ◆ CmdTurnRoadVeh()

CommandCost CmdTurnRoadVeh | ( | DoCommandFlag | flags,
|  | VehicleID | veh_id
| ) |  |

Turn a roadvehicle around.

Parameters

  flags | operation to perform
  veh_id | vehicle ID to turn

Returns
  the cost of this operation or an error

Definition at line 366 of file roadveh_cmd.cpp.

References Vehicle::breakdown_ctr, CheckOwnership(), CMD_ERROR, Vehicle::current_order, CommandCost::Failed(), SpecializedVehicle< RoadVehicle, Type >::GetIfValid(), RoadVehicle::IsInDepot(), RoadVehicle::IsPrimaryVehicle(), Order::IsType(), RoadVehicle::overtaking, Vehicle::owner, RVSB_WORMHOLE, RoadVehicle::state, Vehicle::vehstatus, VS_CRASHED, and VS_STOPPED.