OpenTTD Source 20241224-master-gf74b0cf984
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.
 
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.
 

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, _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().

◆ CmdTurnRoadVeh()

◆ IndividualRoadVehicleController()

bool IndividualRoadVehicleController ( RoadVehicle v,
const RoadVehicle prev 
)

Definition at line 1135 of file roadveh_cmd.cpp.

◆ 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().

Referenced by CheckRoadSide().

◆ RoadVehLeaveDepot()

bool RoadVehLeaveDepot ( RoadVehicle v,
bool  first 
)

Definition at line 1002 of file roadveh_cmd.cpp.