OpenTTD Source 20241224-master-gf74b0cf984
ship_cmd.h File Reference

Command definitions related to ships. More...

#include "command_type.h"
#include "engine_type.h"
#include "vehicle_type.h"

Go to the source code of this file.

Functions

CommandCost CmdBuildShip (DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **v)
 Build a ship.
 

Detailed Description

Command definitions related to ships.

Definition in file ship_cmd.h.

Function Documentation

◆ CmdBuildShip()

CommandCost CmdBuildShip ( DoCommandFlag  flags,
TileIndex  tile,
const Engine e,
Vehicle **  ret 
)

Build a ship.

Parameters
flagstype of operation.
tiletile of the depot where ship 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 895 of file ship_cmd.cpp.

References _current_company, ShipVehicleInfo::acceleration, Vehicle::acceleration, Vehicle::build_year, Vehicle::cargo_cap, Vehicle::cargo_type, TimerGameCalendar::date, TimerGameEconomy::date, Vehicle::date_of_last_service, Vehicle::date_of_last_service_newgrf, DC_EXEC, Engine::DetermineCapacity(), ENGINE_EXCLUSIVE_PREVIEW, Vehicle::engine_type, Engine::flags, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), Engine::GetDefaultCargoType(), Engine::GetLifeLengthInDays(), GetShipDepotNorthTile(), GetSlopePixelZ(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, Vehicle::InvalidateNewGRFCacheOfChain(), IsValidCargoID(), Vehicle::last_loading_station, Vehicle::last_station_visited, Vehicle::max_age, Vehicle::owner, Vehicle::random_bits, Vehicle::refit_cap, Engine::reliability, Vehicle::reliability, Engine::reliability_spd_dec, Vehicle::reliability_spd_dec, VehicleSpriteSeq::Set(), SetBit(), settings, Vehicle::sprite_cache, MutableSpriteCache::sprite_seq, Vehicle::spritenum, Ship::state, Vehicle::tile, TILE_SIZE, TileX(), TileY(), TRACK_BIT_DEPOT, Ship::UpdateCache(), Ship::UpdateDeltaXY(), Vehicle::UpdatePosition(), BaseConsist::vehicle_flags, 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().