Go to the documentation of this file.
36 #include "table/strings.h"
41 const uint32 _veh_build_proc_table[] = {
48 const uint32 _veh_sell_proc_table[] = {
55 const uint32 _veh_refit_proc_table[] = {
62 const uint32 _send_to_depot_proc_table[] = {
111 bool refitting = cargo !=
CT_INVALID && cargo != default_cargo;
118 case VEH_SHIP: num_vehicles = 1;
break;
120 default: NOT_REACHED();
128 if (unit_num == UINT16_MAX)
return_cmd_error(STR_ERROR_TOO_MANY_VEHICLES_IN_GAME);
146 default: NOT_REACHED();
184 if (flags != subflags) {
217 if (ret.
Failed())
return ret;
262 if (e->
GetGRF() !=
nullptr) {
268 *auto_refit_allowed =
HasBit(cb_res, 14);
269 int factor =
GB(cb_res, 0, 14);
270 if (factor >= 0x2000) factor -= 0x4000;
275 *auto_refit_allowed = e->info.refit_cost == 0;
276 return (v ==
nullptr || v->
cargo_type != new_cid) ? e->info.refit_cost : 0;
293 int cost_factor =
GetRefitCostFactor(v, engine_type, new_cid, new_subtype, auto_refit_allowed);
296 base_price = PR_BUILD_VEHICLE_SHIP;
301 base_price = PR_BUILD_VEHICLE_ROAD;
306 base_price = PR_BUILD_VEHICLE_AIRCRAFT;
311 base_price = (e->u.rail.railveh_type ==
RAILVEH_WAGON) ? PR_BUILD_VEHICLE_WAGON : PR_BUILD_VEHICLE_TRAIN;
316 default: NOT_REACHED();
318 if (cost_factor < 0) {
348 uint total_capacity = 0;
349 uint total_mail_capacity = 0;
350 num_vehicles = num_vehicles == 0 ? UINT8_MAX : num_vehicles;
352 VehicleSet vehicles_to_refit;
359 std::vector<RefitResult> refit_result;
362 byte actual_subtype = new_subtype;
363 for (; v !=
nullptr; v = (only_this ? nullptr : v->
Next())) {
367 if (v->
type ==
VEH_TRAIN && std::find(vehicles_to_refit.begin(), vehicles_to_refit.end(), v->
index) == vehicles_to_refit.end() && !only_this)
continue;
375 if (!refittable && v->
cargo_type != new_cid)
continue;
378 if (actual_subtype == 0xFF) {
390 uint16 mail_capacity = 0;
392 total_capacity += amount;
394 total_mail_capacity += mail_capacity;
396 if (!refittable)
continue;
402 bool auto_refit_allowed;
404 if (auto_refit && (flags &
DC_QUERY_COST) == 0 && !auto_refit_allowed) {
408 total_capacity -= amount;
409 total_mail_capacity -= mail_capacity;
429 refit_result.push_back({v, amount, mail_capacity, actual_subtype});
450 refit_result.clear();
483 if (ret.
Failed())
return ret;
485 bool auto_refit =
HasBit(p2, 24);
503 byte new_subtype =
GB(p2, 8, 8);
508 uint8 num_vehicles =
GB(p2, 16, 8);
533 default: NOT_REACHED();
568 if (ret.
Failed())
return ret;
597 if (v->
GetGRF()->grf_version < 8) {
601 if (callback < 0x400) {
609 error = STR_ERROR_INCOMPATIBLE_RAIL_TYPES;
647 bool vehicle_list_window =
HasBit(p1, 1);
653 if (vehicle_list_window) {
660 for (uint i = 0; i < list.size(); i++) {
688 VehicleType vehicle_type = Extract<VehicleType, 0, 3>(p1);
692 uint sell_command = GetCmdSellVeh(vehicle_type);
698 bool had_success =
false;
699 for (uint i = 0; i < list.size(); i++) {
709 return had_success ? cost : last_error;
725 VehicleType vehicle_type = Extract<VehicleType, 0, 3>(p1);
733 for (uint i = 0; i < list.size(); i++) {
754 if (!v->name.empty() && v->name == name)
return false;
770 size_t number_position;
771 for (number_position = src->
name.length(); number_position > 0; number_position--) {
774 if (src->
name[number_position - 1] <
'0' || src->
name[number_position - 1] >
'9')
break;
780 if (number_position == src->
name.length()) {
784 number_position = buf.length();
788 buf = src->
name.substr(0, number_position);
790 auto num_str = src->
name.substr(number_position);
791 padding = (byte)num_str.length();
793 std::istringstream iss(num_str);
799 for (
int max_iterations = 1000; max_iterations > 0; max_iterations--, num++) {
800 std::ostringstream oss;
803 oss << buf << std::setw(padding) << std::setfill(
'0') << std::internal << num;
806 auto new_name = oss.str();
808 dst->
name = new_name;
845 if (ret.
Failed())
return ret;
854 }
while ((v = v->
Next()) !=
nullptr);
882 if (w_front !=
nullptr)
DoCommand(w_front->
tile, w_front->
index | (1 << 20), 0, flags, GetCmdSellVeh(w_front));
910 w->SetServiceIntervalIsCustom(v->ServiceIntervalIsCustom());
911 w->SetServiceIntervalIsPercent(v->ServiceIntervalIsPercent());
919 _new_vehicle_id = w_front->
index;
941 assert(w !=
nullptr);
970 }
while (v !=
nullptr);
1017 bool had_success =
false;
1018 for (uint i = 0; i < list.size(); i++) {
1029 if (!(flags &
DC_EXEC))
break;
1078 if (ret.
Failed())
return ret;
1119 if (ret.
Failed())
return ret;
1122 bool iscustom =
HasBit(p2, 16);
1127 serv_int =
GB(p2, 0, 16);
1134 v->SetServiceInterval(serv_int);
1135 v->SetServiceIntervalIsCustom(iscustom);
1136 v->SetServiceIntervalIsPercent(ispercent);
@ VEH_AIRCRAFT
Aircraft vehicle type.
uint TotalCount() const
Returns sum of cargo, including reserved cargo.
virtual bool IsChainInDepot() const
Check whether the whole vehicle chain is in the depot.
uint GetDisplayDefaultCapacity(uint16 *mail_capacity=nullptr) const
Determines the default cargo capacity of an engine for display purposes.
static bool IsCompanyBuildableVehicleType(VehicleType type)
Is the given vehicle type buildable by a company?
#define CMD_MSG(x)
Used to combine a StringID with the command.
uint32 TileIndex
The index/ID of a Tile.
void InvalidateWindowData(WindowClass cls, WindowNumber number, int data, bool gui_scope)
Mark window data of the window of a given class and specific window number as invalid (in need of re-...
@ CMD_REFIT_VEHICLE
refit the cargo space of a vehicle
CommandCost CmdBuildShip(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v)
Build a ship.
@ EXPENSES_ROADVEH_RUN
Running costs road vehicles.
uint mail_capacity
New mail capacity of aircraft.
CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags)
Shorthand for calling the long DoCommand with a container.
bool IsType(OrderType type) const
Check whether this order is of the given type.
std::vector< const Vehicle * > VehicleList
A list of vehicles.
static Titem * Get(size_t index)
Returns Titem with given index.
CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *v, uint16 data, uint32 user)
Sell a (single) train wagon/engine.
void SetWindowDirty(WindowClass cls, WindowNumber number)
Mark window as dirty (in need of repainting)
uint16 GetServiceIntervalClamped(uint interval, bool ispercent)
Clamp the service interval to the correct min/max.
static void CountEngine(const Vehicle *v, int delta)
Update num_engines when adding/removing an engine.
Money GetPrice(Price index, uint cost_factor, const GRFFile *grf_file, int shift)
Determine a certain price.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
Money value
Value of the vehicle.
@ CMD_ADD_VEHICLE_GROUP
add a vehicle to a group
@ CMD_MOVE_RAIL_VEHICLE
move a rail vehicle (in the depot)
byte subtype
Type of aircraft.
@ CBID_VEHICLE_START_STOP_CHECK
Called when the company (or AI) tries to start or stop a vehicle.
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
static const CommandCost CMD_ERROR
Define a default return value for a failed command.
The information about a vehicle list.
Vehicle * GetNextVehicle() const
Get the next real (non-articulated part) vehicle in the consist.
Vehicle * Next() const
Get the next vehicle of this vehicle.
static CommandCost SendAllVehiclesToDepot(DoCommandFlag flags, bool service, const VehicleListIdentifier &vli)
Send all vehicles of type to depots.
uint16 UnitID
Type for the company global vehicle unit number.
Price
Enumeration of all base prices for use with Prices.
void GetVehicleSet(VehicleSet &set, Vehicle *v, uint8 num_vehicles)
Calculates the set of vehicles that will be affected by a given selection.
std::string name
Name of vehicle.
@ DEPOT_MASS_SEND
Tells that it's a mass send to depot command (type in VLW flag)
Stores the state of all random number generators.
Tindex index
Index of this pool item.
@ CMD_SEND_VEHICLE_TO_DEPOT
send a vehicle to a depot
static CargoSpec * Get(size_t index)
Retrieve cargo details for the given cargo ID.
uint16 crash_anim_pos
Crash animation counter.
bool UnpackIfValid(uint32 data)
Unpack a VehicleListIdentifier from a single uint32.
GroupID group_id
Index of group Pool array.
CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v)
Build a road vehicle.
void DeleteVehicleNews(VehicleID vid, StringID news)
Delete a news item type about a vehicle.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
CommandCost CmdSellVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Sell a vehicle.
static void CountVehicle(const Vehicle *v, int delta)
Update num_vehicle when adding or removing a vehicle.
static void SaveRandomSeeds(SavedRandomSeeds *storage)
Saves the current seeds.
uint16 _returned_mail_refit_capacity
Stores the mail capacity after a refit operation (Aircraft only).
VehicleDefaultSettings vehicle
default settings for vehicles
const GRFFile * GetGRF() const
Retrieve the NewGRF the vehicle is tied to.
@ EXPENSES_AIRCRAFT_RUN
Running costs aircraft.
Specification of a cargo type.
static bool IsUniqueVehicleName(const char *name)
Test if a name is unique among vehicle names.
bool IsRearDualheaded() const
Tell if we are dealing with the rear end of a multiheaded engine.
@ CCF_REFIT
Valid changes for refitting in a depot.
@ WC_COMPANY
Company view; Window numbers:
Vehicle * GetNextArticulatedPart() const
Get the next part of an articulated engine.
@ VEH_ROAD
Road vehicle type.
uint16 cur_speed
current speed
virtual bool IsPrimaryVehicle() const
Whether this is the primary vehicle in the chain.
bool IsGroundVehicle() const
Check if the vehicle is a ground vehicle.
bool IsShared() const
Is this a shared order list?
CargoID GetDefaultCargoType() const
Determines the default cargo type of an engine.
Owner owner
Which company owns the vehicle?
uint16 GetVehicleCallback(CallbackID callback, uint32 param1, uint32 param2, EngineID engine, const Vehicle *v)
Evaluate a newgrf callback for vehicles.
@ DC_EXEC
execute the given command
CommandCost CmdChangeServiceInt(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Change the service interval of a vehicle.
static bool IsLocalCompany()
Is the current company the local company?
DoCommandFlag
List of flags for a command.
uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
Count the number of articulated parts of an engine.
bool Succeeded() const
Did this command succeed?
@ CMD_SELL_VEHICLE
sell a vehicle
@ TERM7
Heading for terminal 7.
static void RestoreRandomSeeds(const SavedRandomSeeds &storage)
Restores previously saved seeds.
static bool IsDepotTile(TileIndex tile)
Is the given tile a tile with a depot on it?
bool IsArticulatedPart() const
Check if the vehicle is an articulated part of an engine.
Aircraft, helicopters, rotors and their shadows belong to this class.
void UpdateCache()
Update the caches of this ship.
const GRFFile * GetGRF() const
Retrieve the NewGRF the engine is tied to.
void SetWindowWidgetDirty(WindowClass cls, WindowNumber number, byte widget_index)
Mark a particular widget in a particular window as dirty (in need of repainting)
static int GetRefitCostFactor(const Vehicle *v, EngineID engine_type, CargoID new_cid, byte new_subtype, bool *auto_refit_allowed)
Helper to run the refit cost callback.
size_t Utf8StringLength(const char *s)
Get the length of an UTF-8 encoded string in number of characters and thus not the number of bytes th...
@ CBID_VEHICLE_REFIT_COST
Called to determine the cost factor for refitting a vehicle.
uint16 EngineID
Unique identification number of an engine.
CommandCost CheckOwnership(Owner owner, TileIndex tile)
Check whether the current owner owns something.
@ EF_AUTO_REFIT
Automatic refitting is allowed.
#define return_cmd_error(errcode)
Returns from a function with a specific StringID as error.
Common return value for all commands.
@ VAF_HELI_DIRECT_DESCENT
The helicopter is descending directly at its destination (helipad or in front of hangar)
uint Truncate(uint max_move=UINT_MAX)
Truncates the cargo in this list to the given amount.
@ WC_VEHICLE_VIEW
Vehicle view; Window numbers:
static CommandCost GetRefitCost(const Vehicle *v, EngineID engine_type, CargoID new_cid, byte new_subtype, bool *auto_refit_allowed)
Learn the price of refitting a certain engine.
TileIndex tile
Current tile index.
EngineID engine_type
The type of engine used for this vehicle.
CommandCost CmdDepotSellAllVehicles(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Sells all vehicles in a depot.
@ VS_CRASHED
Vehicle is crashed.
bool do_start
flag for starting playback of next_file at next opportunity
UnitID GetFreeUnitNumber(VehicleType type)
Get an unused unit number for a vehicle (if allowed).
VehicleCargoList cargo
The cargo this vehicle is carrying.
bool Failed() const
Did this command fail?
virtual ExpensesType GetExpenseType(bool income) const
Sets the expense type associated to this vehicle type.
Order current_order
The current order (+ status, like: loading)
GroundVehicleCache gcache
Cache of often calculated values.
bool IsFrontEngine() const
Check if the vehicle is a front engine.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
@ DC_AUTOREPLACE
autoreplace/autorenew is in progress, this shall disable vehicle limits when building,...
@ WC_VEHICLE_DETAILS
Vehicle details; Window numbers:
@ VS_STOPPED
Vehicle is stopped by the player.
uint32 GetGRFID() const
Retrieve the GRF ID of the NewGRF the vehicle is tied to.
static void CloneVehicleName(const Vehicle *src, Vehicle *dst)
Clone the custom name of a vehicle, adding or incrementing a number.
const Engine * GetEngine() const
Retrieves the engine of the vehicle.
void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engines, VehicleList *wagons, bool individual_wagons)
Generate a list of vehicles inside a depot.
bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli)
Generate a list of vehicles based on window type.
static void UpdateAutoreplace(CompanyID company)
Update autoreplace_defined and autoreplace_finished of all statistics of a company.
Vehicle * v
Vehicle to refit.
static const uint32 MAKE_ORDER_BACKUP_FLAG
Flag to pass to the vehicle construction command when an order should be preserved.
static void Restore(Vehicle *v, uint32 user)
Restore the data of this order to the given vehicle.
Money GetCost() const
The costs as made up to this moment.
DepotCommand
Flags to add to p1 for goto depot commands.
StringID GetGRFStringID(uint32 grfid, StringID stringid)
Returns the index for this stringid associated with its grfID.
static bool IsTileOwner(TileIndex tile, Owner owner)
Checks if a tile belongs to the given owner.
static bool StrEmpty(const char *s)
Check if a string buffer is empty.
@ VRF_REVERSE_DIRECTION
Reverse the visible direction of the vehicle.
static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles, CargoID new_cid, byte new_subtype, DoCommandFlag flags, bool auto_refit)
Refits a vehicle (chain).
CommandCost CmdSendVehicleToDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Send a vehicle to the depot.
Money GetCost() const
Return how much a new engine costs.
void AddCost(const Money &cost)
Adds the given cost to the cost of the command.
CommandCost SendToDepot(DoCommandFlag flags, DepotCommand command)
Send this vehicle to the depot using the given command(s).
VehicleType
Available vehicle types.
CommandCost CmdRefitVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Refits a vehicle to the specified cargo type.
bool CheckCompanyHasMoney(CommandCost &cost)
Verify whether the company can pay the bill.
byte misc_flags
Miscellaneous flags.
@ RAILVEH_WAGON
simple wagon, not motorized
uint _returned_refit_capacity
Stores the capacity after a refit operation.
void UpdateAircraftCache(Aircraft *v, bool update_range=false)
Update cached values of an aircraft.
OrderList * list
Pointer to the order list for this vehicle.
@ CMD_START_STOP_VEHICLE
start or stop a vehicle
static WindowClass GetWindowClassForVehicleType(VehicleType vt)
Get WindowClass for vehicle list of given vehicle type.
Helper structure for RefitVehicle()
static const uint CALLBACK_FAILED
Different values for Callback result evaluations.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
@ CCF_AUTOREFIT
Valid changes for autorefitting in stations.
CompanyID _current_company
Company currently doing an action.
@ DEPOT_SERVICE
The vehicle will leave the depot right after arrival (service only)
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
Vehicle * First() const
Get the first vehicle of this vehicle chain.
uint16 cargo_cap
total capacity
bool CanCarryCargo() const
Determines whether an engine can carry something.
void RoadVehUpdateCache(RoadVehicle *v, bool same_length=false)
Update the cache of a road vehicle.
static const uint MAX_LENGTH_VEHICLE_NAME_CHARS
The maximum length of a vehicle name in characters including '\0'.
uint32 cached_power
Total power of the consist (valid only for the first engine).
static Train * From(Vehicle *v)
Converts a Vehicle to SpecializedVehicle with type checking.
uint8 roadveh_acceleration_model
realistic acceleration for road vehicles
void ConsistChanged(ConsistChangeFlags allowed_changes)
Recalculates the cached stuff of a train.
VehicleType vtype
The vehicle type associated with this list.
void InvalidateNewGRFCacheOfChain()
Invalidates cached NewGRF variables of all vehicles in the chain (after the current vehicle)
int CompanyServiceInterval(const Company *c, VehicleType type)
Get the service interval for the given company and vehicle type.
CommandCost CmdBuildRailVehicle(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v)
Build a railroad vehicle.
void InvalidateWindowClassesData(WindowClass cls, int data, bool gui_scope)
Mark window data of all windows of a given class as invalid (in need of re-computing) Note that by de...
CommandCost CmdStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Start/Stop a vehicle.
@ CMD_AUTOREPLACE_VEHICLE
replace/renew a vehicle while it is in a depot
@ RAILVEH_MULTIHEAD
indicates a combination of two locomotives
@ WC_VEHICLE_DEPOT
Depot view; Window numbers:
uint16 classes
Classes of this cargo type.
union Vehicle::@51 orders
The orders currently assigned to the vehicle.
@ NUM_CARGO
Maximal number of cargo types in a game.
bool HasArticulatedPart() const
Check if an engine has an articulated part.
uint8 cargo_map[NUM_CARGO]
Inverse cargo translation table (CargoID -> local ID)
static bool CanAllocateItem(size_t n=1)
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function()
CommandCost CmdDepotMassAutoReplace(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Autoreplace all vehicles in the depot.
CommandCost CmdMassStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Starts or stops a lot of vehicles.
UnitID unitnumber
unit number, for display purposes only
@ EXPENSES_NEW_VEHICLES
New vehicles.
void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g)
Rebuild the left autoreplace list if an engine is removed or added.
void CDECL error(const char *s,...)
Error handling for fatal non-user errors.
@ AIR_CTOL
Conventional Take Off and Landing, i.e. planes.
uint16 service_interval
The interval for (automatic) servicing; either in days or %.
bool servint_ispercent
service intervals are in percents
static T SetBit(T &x, const uint8 y)
Set a bit in a variable.
void MarkWholeScreenDirty()
This function mark the whole screen as dirty.
static void Backup(const Vehicle *v, uint32 user)
Create an order backup for the given vehicle.
@ EXPENSES_TRAIN_RUN
Running costs trains.
@ STARTTAKEOFF
Airplane has arrived at a runway for take-off.
uint DetermineCapacity(const Vehicle *v, uint16 *mail_capacity=nullptr) const
Determines capacity of a given vehicle from scratch.
byte CargoID
Cargo slots to indicate a cargo type within a game.
bool IsStoppedInDepot() const
Check whether the vehicle is in the depot and stopped.
void CargoChanged()
Recalculates the cached weight of a vehicle and its parts.
CargoID cargo_type
type of cargo this vehicle is carrying
byte state
State of the airport.
VehicleSettings vehicle
options for vehicles
@ CMD_BUILD_VEHICLE
build a vehicle
byte cargo_subtype
Used for livery refits (NewGRF variations)
bool IsFreeWagon() const
Check if the vehicle is a free wagon (got no engine in front of it).
@ VEH_TRAIN
Train vehicle type.
uint capacity
New capacity of vehicle.
VehicleType type
Type of vehicle.
@ DC_QUERY_COST
query cost only, don't build.
byte subtype
cargo subtype to refit to
ExpensesType
Types of expenses.
@ CT_INVALID
Invalid cargo type.
@ VEH_SHIP
Ship vehicle type.
CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v)
Build an aircraft.
void SetWindowClassesDirty(WindowClass cls)
Mark all windows of a particular class as dirty (in need of repainting)
CommandCost CmdRenameVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Give a custom name to your vehicle.
CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Clone a vehicle.
CompanySettings settings
settings specific for each company
byte flags
Aircraft flags.
bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company)
Check if an engine is buildable.
byte GetBestFittingSubType(Vehicle *v_from, Vehicle *v_for, CargoID dest_cargo_type)
Get the best fitting subtype when 'cloning'/'replacing' v_from with v_for.
VehicleOrderID GetNumOrders() const
Get number of orders in the order list.
@ EXPENSES_SHIP_RUN
Running costs ships.
virtual void MarkDirty()
Marks the vehicles to be redrawn and updates cached variables.
VehicleType type
Vehicle type, ie VEH_ROAD, VEH_TRAIN, etc.
uint16 refit_cap
Capacity left over from before last refit.
@ CMD_CLONE_ORDER
clone (and share) an order
@ DEPOT_DONT_CANCEL
Don't cancel current goto depot command if any.
static VehicleType GetDepotVehicleType(TileIndex t)
Get the type of vehicles that can use a depot.
CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Build a vehicle.