OpenTTD Source
20241120-master-g6d3adc6169
|
Command definitions related to road vehicles. More...
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... | |
Command definitions related to road vehicles.
Definition in file roadveh_cmd.h.
CommandCost CmdBuildRoadVehicle | ( | DoCommandFlag | flags, |
TileIndex | tile, | ||
const Engine * | e, | ||
Vehicle ** | ret | ||
) |
Build a road vehicle.
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. |
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.
CommandCost CmdTurnRoadVeh | ( | DoCommandFlag | flags, |
VehicleID | veh_id | ||
) |
Turn a roadvehicle around.
flags | operation to perform |
veh_id | vehicle ID to turn |
Definition at line 361 of file roadveh_cmd.cpp.
References Vehicle::breakdown_ctr, CheckOwnership(), CMD_ERROR, Vehicle::current_order, CommandCost::Failed(), SpecializedVehicle< T, Type >::GetIfValid(), RoadVehicle::IsInDepot(), RoadVehicle::IsPrimaryVehicle(), Order::IsType(), RoadVehicle::overtaking, Vehicle::owner, RVSB_WORMHOLE, RoadVehicle::state, Vehicle::vehstatus, VS_CRASHED, and VS_STOPPED.
bool RoadVehiclesAreBuilt | ( | ) |
Verify whether a road vehicle is available.
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().