OpenTTD Source  20241120-master-g6d3adc6169
roadveh_cmd.h File Reference

Command definitions related to road vehicles. More...

#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)
 
bool IndividualRoadVehicleController (RoadVehicle *v, const RoadVehicle *prev)
 
bool RoadVehiclesAreBuilt ()
 Verify whether a road vehicle is available. More...
 
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
flagstype of operation.
tiletile of the depot where road vehicle is built.
ethe engine to build.
[out]retthe vehicle that has been built.
Returns
the cost of this operation or an error.

Definition at line 261 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 
)

◆ RoadVehiclesAreBuilt()

bool RoadVehiclesAreBuilt ( )

Verify whether a road vehicle is available.

Returns
true if at least one road vehicle is available, false if not

Definition at line 179 of file road_cmd.cpp.

References SpecializedVehicle< T, Type >::Iterate().