OpenTTD Source 20241224-master-gf74b0cf984
|
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. | |
CommandCost | CmdBuildRoadVehicle (DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **v) |
Build a road vehicle. | |
CommandCost | CmdTurnRoadVeh (DoCommandFlag flags, VehicleID veh_id) |
Turn a roadvehicle around. | |
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, _settings_game, AddArticulatedParts(), Vehicle::build_year, GroundVehicleCache::cached_veh_length, Vehicle::cargo_cap, Vehicle::cargo_type, GroundVehicle< T, Type >::CargoChanged(), CheckConsistencyOfArticulatedVehicle(), RoadVehicle::compatible_roadtypes, TimerGameCalendar::date, TimerGameEconomy::date, Vehicle::date_of_last_service, Vehicle::date_of_last_service_newgrf, DC_EXEC, DiagDirToDir(), Vehicle::direction, ENGINE_EXCLUSIVE_PREVIEW, Vehicle::engine_type, GroundVehicleCache::first_engine, Engine::flags, GroundVehicle< T, Type >::gcache, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), Engine::GetDefaultCargoType(), Engine::GetLifeLengthInDays(), GetRoadDepotDirection(), GetRoadTypeInfo(), GetSlopePixelZ(), HasTileAnyRoadType(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_ENGINE, Vehicle::InvalidateNewGRFCache(), Vehicle::InvalidateNewGRFCacheOfChain(), IsValidCargoID(), Vehicle::last_loading_station, Vehicle::last_station_visited, Vehicle::max_age, SpecializedVehicle< T, Type >::Next(), Vehicle::owner, RoadTypeInfo::powered_roadtypes, Vehicle::random_bits, Vehicle::refit_cap, Engine::reliability, Vehicle::reliability, Engine::reliability_spd_dec, Vehicle::reliability_spd_dec, RoadVehicleInfo::roadtype, RoadVehicle::roadtype, VehicleSettings::roadveh_acceleration_model, RoadVehUpdateCache(), RVSB_IN_DEPOT, VehicleSpriteSeq::Set(), SetBit(), GroundVehicle< T, Type >::SetFrontEngine(), settings, Vehicle::sprite_cache, MutableSpriteCache::sprite_seq, Vehicle::spritenum, RoadVehicle::state, Vehicle::tile, TILE_SIZE, TileX(), TileY(), Vehicle::UpdatePosition(), GameSettings::vehicle, BaseConsist::vehicle_flags, VEHICLE_LENGTH, Vehicle::vehstatus, VF_BUILT_AS_PROTOTYPE, VS_DEFPAL, VS_HIDDEN, VS_STOPPED, Vehicle::x_pos, Vehicle::y_pos, TimerGameCalendar::year, and Vehicle::z_pos.
Referenced by CmdBuildVehicle().
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, DC_EXEC, Vehicle::direction, DirToDiagDir(), DRD_NONE, CommandCost::Failed(), GetDisallowedRoadDirections(), SpecializedVehicle< T, Type >::GetIfValid(), GetTunnelBridgeDirection(), RoadVehicle::IsInDepot(), IsNormalRoadTile(), RoadVehicle::IsPrimaryVehicle(), IsTileType(), Order::IsType(), MP_TUNNELBRIDGE, RoadVehicle::overtaking, Vehicle::owner, BaseConsist::ResetDepotUnbunching(), RVSB_WORMHOLE, RoadVehicle::state, Vehicle::tile, Vehicle::vehstatus, VS_CRASHED, and VS_STOPPED.
bool IndividualRoadVehicleController | ( | RoadVehicle * | v, |
const RoadVehicle * | prev | ||
) |
Definition at line 1135 of file roadveh_cmd.cpp.
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().
Referenced by CheckRoadSide().
bool RoadVehLeaveDepot | ( | RoadVehicle * | v, |
bool | first | ||
) |
Definition at line 1002 of file roadveh_cmd.cpp.