38 #include "table/strings.h" 61 static const uint16 _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D};
64 bool IsValidImageIndex<VEH_SHIP>(uint8 image_index)
66 return image_index <
lengthof(_ship_sprites);
77 uint8 spritenum = e->u.ship.image_index;
79 if (is_custom_sprite(spritenum)) {
80 GetCustomVehicleIcon(engine,
DIR_W, image_type, result);
86 assert(IsValidImageIndex<VEH_SHIP>(spritenum));
87 result->
Set(
DIR_W + _ship_sprites[spritenum]);
93 GetShipIcon(engine, image_type, &seq);
97 preferred_x =
Clamp(preferred_x,
116 GetShipIcon(engine, image_type, &seq);
121 width =
UnScaleGUI(rect.right - rect.left + 1);
122 height =
UnScaleGUI(rect.bottom - rect.top + 1);
133 if (is_custom_sprite(spritenum)) {
134 GetCustomVehicleSprite(
this, direction, image_type, result);
140 assert(IsValidImageIndex<VEH_SHIP>(spritenum));
141 result->
Set(_ship_sprites[spritenum] + direction);
144 static const Depot *FindClosestShipDepot(
const Vehicle *v, uint max_distance)
147 const Depot *best_depot =
nullptr;
153 uint best_dist = max_distance == 0 ? UINT_MAX : max_distance + 1;
159 if (dist < best_dist) {
169 static void CheckIfShipNeedsService(
Vehicle *v)
181 default: NOT_REACHED();
184 const Depot *depot = FindClosestShipDepot(v, max_distance);
186 if (depot ==
nullptr) {
195 v->SetDestTile(depot->xy);
230 CheckVehicleBreakdown(
this);
232 CheckIfShipNeedsService(
this);
274 static void PlayShipSound(
const Vehicle *v)
277 SndPlayVehicleFx(ShipVehInfo(v->
engine_type)->sfx, v);
301 static const int8 _delta_xy_table[8][4] = {
313 const int8 *bb = _delta_xy_table[this->
rotation];
338 static bool CheckShipLeaveDepot(
Ship *v)
366 if (north_tracks && south_tracks) {
368 bool reverse =
false;
372 default: NOT_REACHED();
380 }
else if (south_tracks) {
403 static bool ShipAccelerate(
Vehicle *v)
420 if (spd == 0)
return false;
421 if ((byte)++spd == 0)
return true;
436 if (!(st->had_vehicle_of_type &
HVOT_SHIP)) {
441 STR_NEWS_FIRST_SHIP_ARRIVAL,
465 bool path_found =
true;
476 if (!v->
path.empty()) {
479 if (
HasBit(tracks, track)) {
492 default: NOT_REACHED();
514 static const byte _ship_subcoord[4][6][3] = {
560 if ((v->
x_pos & 0xF) != 8 || (v->
y_pos & 0xF) != 8)
return 0;
583 if (dz == 0)
return false;
621 static void ShipController(
Ship *v)
640 if (CheckShipLeaveDepot(v))
return;
656 if (!ShipAccelerate(v))
return;
692 if ((gp.x & 0xF) == 8 && (gp.
y & 0xF) == 8) {
725 b = _ship_subcoord[diagdir][track];
727 gp.x = (gp.x & ~0xF) | b[0];
728 gp.
y = (gp.
y & ~0xF) | b[1];
776 if (!v->
path.empty()) v->
path.pop_front();
804 ShipController(
this);
843 v->
z_pos = GetSlopePixelZ(x, y);
860 _new_vehicle_id = v->
index;
889 const Depot *depot = FindClosestShipDepot(
this, 0);
891 if (depot ==
nullptr)
return false;
893 if (location !=
nullptr) *location = depot->xy;
894 if (destination !=
nullptr) *destination = depot->
index;
Information about a ship vehicle.
Functions related to OTTD's strings.
Track YapfShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found, ShipPathCache &path_cache)
Finds the best path for given ship using YAPF.
static TrackBits GetAvailShipTracks(TileIndex tile, DiagDirection dir, Trackdir trackdir)
Get the available water tracks on a tile for a ship entering a tile.
bool HasVehicleOnPos(TileIndex tile, void *data, VehicleFromPosProc *proc)
Checks whether a vehicle is on a specific location.
This vehicle is in the exclusive preview stage, either being used or being offered to a company...
uint16 reliability
Current reliability of the engine.
uint32 PaletteID
The number of the palette.
StationFacility facilities
The facilities that this station has.
Vehicle is stopped by the player.
First vehicle arrived for competitor.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
bool Contains(TileIndex tile) const
Does this tile area contain a tile?
static void NewEvent(class ScriptEvent *event)
Queue a new event for a Game Script.
Definition of stuff that is very close to a company, like the company struct itself.
Functions for NewGRF engines.
void DecreaseVehicleValue(Vehicle *v)
Decrease the value of a vehicle.
static const int DAYS_IN_YEAR
days per year
static TransportType GetTunnelBridgeTransportType(TileIndex t)
Tunnel: Get the transport type of the tunnel (road or rail) Bridge: Get the transport type of the bri...
Direction direction
facing
void ShowVisualEffect() const
Draw visual effects (smoke and/or sparks) for a vehicle chain.
static byte GetLockPart(TileIndex t)
Get the part of a lock.
Flag for an invalid track.
void SetWindowDirty(WindowClass cls, WindowNumber number)
Mark window as dirty (in need of repainting)
static DiagDirection DirToDiagDir(Direction dir)
Convert a Direction to a DiagDirection.
static Axis GetShipDepotAxis(TileIndex t)
Get the axis of the ship depot.
ShipPathCache path
Cached path.
static int UnScaleGUI(int value)
Short-hand to apply GUI zoom level.
uint32 maximum_go_to_depot_penalty
What is the maximum penalty that may be endured for going to a depot.
void CheckOrders(const Vehicle *v)
Check the orders of a vehicle, to see if there are invalid orders and stuff.
static Titem * Get(size_t index)
Returns Titem with given index.
Functions related to dates.
static WaterClass GetWaterClass(TileIndex t)
Get the water class at a tile.
Angle of 45 degrees left.
void PlayLeaveStationSound() const
Play the sound associated with leaving the station.
static TileIndex GetShipDepotNorthTile(TileIndex t)
Get the most northern tile of a ship depot.
static Track TrackdirToTrack(Trackdir trackdir)
Returns the Track that a given Trackdir represents.
Use default vehicle palette.
void GetShipSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs, int &yoffs, EngineImageType image_type)
Get the size of the sprite of a ship sprite heading west (used for lists).
static T SetBit(T &x, const uint8 y)
Set a bit in a variable.
Vehicle drawn in viewport.
bool Tick()
Calls the tick handler of the vehicle.
Trackdir
Enumeration for tracks and directions.
uint16 cur_speed
current speed
uint16 cached_cargo_age_period
Number of ticks before carried cargo is aged.
static TrackBits AxisToTrackBits(Axis a)
Maps an Axis to the corresponding TrackBits value.
Depot view; Window numbers:
Types for recording game performance data.
byte spritenum
currently displayed sprite index 0xfd == custom sprite, 0xfe == custom second head sprite 0xff == res...
Both directions faces to the same direction.
uint ApplyWaterClassSpeedFrac(uint raw_speed, bool is_ocean) const
Apply ocean/canal speed fraction to a velocity.
fluid_settings_t * settings
FluidSynth settings handle.
StationID last_loading_station
Last station the vehicle has stopped at and could possibly leave from with any cargo loaded...
bool IsInDepot() const
Check whether the vehicle is in the depot.
TileIndex dest_tile
Heading for this tile.
NPFSettings npf
pathfinder settings for the new pathfinder
Functions related to vehicles.
void IncrementRealOrderIndex()
Advanced cur_real_order_index to the next real order, keeps care of the wrap-around and invalidates t...
uint32 current_order_time
How many ticks have passed since this order started.
static uint TileX(TileIndex tile)
Get the X component of a tile.
void VehicleEnterDepot(Vehicle *v)
Vehicle entirely entered the depot, update its status, orders, vehicle windows, service it...
void Draw(int x, int y, PaletteID default_pal, bool force_pal) const
Draw the sprite sequence.
PathfinderSettings pf
settings for all pathfinders
static TileIndex TileAddByDiagDir(TileIndex tile, DiagDirection dir)
Adds a DiagDir to a tile.
static void ShipArrivesAt(const Vehicle *v, Station *st)
Ship arrives at a dock.
Base for all depots (except hangars)
Defines the internal data of a functional industry.
void Set(SpriteID sprite)
Assign a single sprite to the sequence.
Tindex index
Index of this pool item.
static const int DAY_TICKS
1 day is 74 ticks; _date_fract used to be uint16 and incremented by 885.
bool IsShipDestinationTile(TileIndex tile, StationID station)
Test if a tile is a docking tile for the given station.
void UpdateViewport(bool force_update, bool update_delta)
Update vehicle sprite- and position caches.
static Track TrackToOppositeTrack(Track t)
Find the opposite track to a given track.
StationID last_station_visited
The last station we stopped at.
uint16 reliability_spd_dec
Reliability decrease speed.
Money GetCost() const
The costs as made up to this moment.
void HandlePathfindingResult(bool path_found)
Handle the pathfinding result, especially the lost status.
Direction rotation
Visible direction.
Flag for an invalid DiagDirection.
Common return value for all commands.
Accessors for industries.
int16 rotation_y_pos
NOSAVE: Y Position before rotation.
EngineImageType
Visualisation contexts of vehicles and engines.
byte flags
Flags of the engine.
Year _cur_year
Current year, starting at 0.
uint16 cached_max_speed
Maximum speed of the consist (minimum of the max speed of all vehicles in the consist).
bool NeedsAutomaticServicing() const
Checks if the current order should be interrupted for a service-in-depot order.
const Engine * GetEngine() const
Retrieves the engine of the vehicle.
CargoID GetDefaultCargoType() const
Determines the default cargo type of an engine.
void OnNewDay()
Calls the new day handler of the vehicle.
static const uint TILE_SIZE
Tile size in world coordinates.
Entry point for OpenTTD to YAPF.
byte VehicleRandomBits()
Get a value for a vehicle's random_bits.
Money GetPrice(Price index, uint cost_factor, const GRFFile *grf_file, int shift)
Determine a certain price.
VehicleSpriteSeq sprite_seq
Vehicle appearance.
uint16 max_speed
Maximum speed (1 unit = 1/3.2 mph = 0.5 km-ish/h)
static bool IsLock(TileIndex t)
Is there a lock on a given water tile?
int GetTileZ(TileIndex tile)
Get bottom height of the tile.
Angle of 45 degrees right.
Slope GetTileSlope(TileIndex tile, int *h)
Return the slope of a given tile inside the map.
static Track TrackBitsToTrack(TrackBits tracks)
Converts TrackBits to Track.
static bool IsValidTile(TileIndex tile)
Checks if a tile is valid.
bool YapfShipCheckReverse(const Ship *v)
Returns true if it is better to reverse the ship before leaving depot using YAPF. ...
TileArea docking_station
Tile area the docking tiles cover.
uint16 cargo_cap
total capacity
static bool IsTileOwner(TileIndex tile, Owner owner)
Checks if a tile belongs to the given owner.
Vehicle is a prototype (accepted as exclusive preview).
static DiagDirection DiagdirBetweenTiles(TileIndex tile_from, TileIndex tile_to)
Determines the DiagDirection to get from one tile to another.
static TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
void UpdateCache()
Update the caches of this ship.
uint16 reliability_spd_dec
Speed of reliability decay between services (per day).
void SubtractMoneyFromCompanyFract(CompanyID company, CommandCost cst)
Subtract money from a company, including the money fraction.
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a given tiletype.
void UpdateDeltaXY()
Updates the x and y offsets and the size of the sprite used for this vehicle.
void MarkDirty()
Marks the vehicles to be redrawn and updates cached variables.
int y
x and y position of the vehicle after moving
void AgeVehicle(Vehicle *v)
Update age of a vehicle.
bool IsValid() const
Check whether the sequence contains any sprites.
YAPFSettings yapf
pathfinder settings for the yet another pathfinder
void MakeDummy()
Makes this order a Dummy order.
int8 y_offs
y offset for vehicle sprite
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
bool IsType(OrderType type) const
Check whether this order is of the given type.
static DiagDirection ReverseDiagDir(DiagDirection d)
Returns the reverse direction of the given DiagDirection.
DoCommandFlag
List of flags for a command.
The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/...
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
byte x_extent
x-extent of vehicle bounding box
void InvalidateNewGRFCacheOfChain()
Invalidates cached NewGRF variables of all vehicles in the chain (after the current vehicle) ...
bool ProcessOrders(Vehicle *v)
Handle the orders of a vehicle and determine the next place to go to if needed.
Direction
Defines the 8 directions on the map.
Flag for an invalid trackdir.
static bool IsDockTile(TileIndex t)
Is tile t a dock tile?
WaterClass GetEffectiveWaterClass(TileIndex tile)
Determine the effective WaterClass for a ship travelling on a tile.
DirDiff
Enumeration for the difference between two directions.
static const int YAPF_TILE_LENGTH
Length (penalty) of one tile with YAPF.
byte z_extent
z-extent of vehicle bounding box
Vehicle starting, i.e. leaving, the station.
static bool IsDockingTile(TileIndex t)
Checks whether the tile is marked as a dockling tile.
CargoID cargo_type
type of cargo this vehicle is carrying
static bool IsValidDiagDirection(DiagDirection d)
Checks if an integer value is a valid DiagDirection.
static Vehicle * EnsureNoVisibleShipProc(Vehicle *v, void *data)
Test-procedure for HasVehicleOnPos to check for a ship.
static const uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in #ZOOM_LVL_BASE.
Vehicle view; Window numbers:
Number of ticks before carried cargo is aged.
TrackBits
Bitfield corresponding to Track.
TileIndex tile
Current tile index.
Grass with a fence and shore or water on the free halftile.
Functions to access the new pathfinder.
static Trackdir TrackDirectionToTrackdir(Track track, Direction dir)
Maps a track and a full (8-way) direction to the trackdir that represents the track running in the gi...
void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const
Gets the sprite to show for the given direction.
static Trackdir DiagDirToDiagTrackdir(DiagDirection diagdir)
Maps a (4-way) direction to the diagonal trackdir that runs in that direction.
bool CanVehicleUseStation(EngineID engine_type, const Station *st)
Can this station be used by the given engine type?
VehicleEnterTileStatus VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y)
Call the tile callback function for a vehicle entering a tile.
static DirDiff DirDifference(Direction d0, Direction d1)
Calculate the difference between two directions.
static Direction ChangeDir(Direction d, DirDiff delta)
Change a direction by a given difference.
int8 x_offs
x offset for vehicle sprite
Owner owner
Which company owns the vehicle?
Sprite sequence for a vehicle part.
#define lengthof(x)
Return the length of an fixed size array.
static T min(const T a, const T b)
Returns the minimum of two values.
static bool IsShipDepotTile(TileIndex t)
Is it a ship depot tile?
uint16 refit_cap
Capacity left over from before last refit.
static DiagDirection GetInclinedSlopeDirection(Slope s)
Returns the direction of an inclined slope.
byte random_bits
Bits used for determining which randomized variational spritegroups to use when drawing.
static bool ShipMoveUpDownOnLock(Ship *v)
Test and move a ship up or down in a lock.
Functions related to sound.
uint16 reliability
Reliability.
Functions to cache sprites in memory.
byte tick_counter
Increased by one for each tick.
Bitflag for a wormhole (used for tunnels)
All ships have this type.
static DepotID GetDepotIndex(TileIndex t)
Get the index of which depot is attached to the tile.
Year build_year
Year the vehicle has been built.
bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event)
Checks whether a NewGRF wants to play a different vehicle sound effect.
TrackStatus GetTileTrackStatus(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
Returns information about trackdirs and signal states.
static void NewEvent(CompanyID company, ScriptEvent *event)
Queue a new event for an AI.
static T Clamp(const T a, const T min, const T max)
Clamp a value between an interval.
static TrackBits DiagdirReachesTracks(DiagDirection diagdir)
Returns all tracks that can be reached when entering a tile from a given (diagonal) direction...
TileIndex GetOrderStationLocation(StationID station)
Determine the location for the station where the vehicle goes to next.
TileIndex old_tile
Current tile of the vehicle.
bool IsValidDockingDirectionForDock(TileIndex t, DiagDirection d)
Check if a dock tile can be docked from the given direction.
static bool IsDiagonalTrack(Track track)
Checks if a given Track is diagonal.
execute the given command
static TrackBits TrackToTrackBits(Track track)
Maps a Track to the corresponding TrackBits value.
Functions related to companies.
static DiagDirection GetShipDepotDirection(TileIndex t)
Get the direction of the ship depot.
GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v)
Get position information of a vehicle when moving one pixel in the direction it is facing...
void UpdatePosition()
Update the position of the vehicle.
static StationID GetStationIndex(TileIndex t)
Get StationID from a tile.
TrackBits state
The "track" the ship is following.
Tunnel entry/exit and bridge heads.
DestinationID GetDestination() const
Gets the destination of this order.
const GRFFile * GetGRF() const
Retrieve the NewGRF the engine is tied to.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
void VehicleServiceInDepot(Vehicle *v)
Service a vehicle and all subsequent vehicles in the consist.
void SetWindowWidgetDirty(WindowClass cls, WindowNumber number, byte widget_index)
Mark a particular widget in a particular window as dirty (in need of repainting)
void MakeGoToDepot(DepotID destination, OrderDepotTypeFlags order, OrderNonStopFlags non_stop_type=ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS, OrderDepotActionFlags action=ODATF_SERVICE_ONLY, CargoID cargo=CT_NO_REFIT)
Makes this order a Go To Depot order.
Time spent processing ships.
bool HandleBreakdown()
Handle all of the aspects of a vehicle breakdown This includes adding smoke and sounds, and ending the breakdown when appropriate.
int GetTileMaxZ(TileIndex t)
Get top height of the tile inside the map.
uint16 EngineID
Unique identification number of an engine.
Ships list; Window numbers:
uint32 TileIndex
The index/ID of a Tile.
static const PaletteID PALETTE_CRASH
Recolour sprite greying of crashed vehicles.
Max. speed: 1 unit = 1/3.2 mph = 0.5 km-ish/h.
uint DistanceManhattan(TileIndex t0, TileIndex t1)
Gets the Manhattan distance between the two given tiles.
void BeginLoading()
Prepare everything to begin the loading when arriving at a station.
void MakeLeaveStation()
Makes this order a Leave Station order.
Date date_of_last_service
Last date the vehicle had a service at a depot.
Position information of a vehicle after it moved.
First vehicle arrived for company.
Track
These are used to specify a single track.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
void Free()
'Free' the order
TileIndex xy
Base tile of the station.
Functions related to zooming.
Trackdir GetVehicleTrackdir() const
Returns the Trackdir on which the vehicle is currently located.
VehicleType type
Type of vehicle.
static Track FindFirstTrack(TrackBits tracks)
Returns first Track from TrackBits or INVALID_TRACK.
static TrackBits TrackStatusToTrackBits(TrackStatus ts)
Returns the present-track-information of a TrackStatus.
Functions related to OTTD's landscape.
static const int NPF_TILE_LENGTH
Length (penalty) of one tile with NPF.
Vehicle details; Window numbers:
Station * neutral_station
Associated neutral station.
static DiagDirection VehicleExitDir(Direction direction, TrackBits track)
Determine the side in which the vehicle will leave the tile.
Base functions for all Games.
static int ShipTestUpDownOnLock(const Ship *v)
Test if a ship is in the centre of a lock and should move up or down.
CompanyID _current_company
Company currently doing an action.
uint32 maximum_go_to_depot_penalty
What is the maximum penalty that may be endured for going to a depot.
Functions that have tunnels and bridges in common.
uint8 original_image_index
Original vehicle image index, thus the image index of the overridden vehicle.
byte running_ticks
Number of ticks this vehicle was not stopped this day.
byte y_extent
y-extent of vehicle bounding box
EngineID engine_type
The type of engine used for this vehicle.
uint16 vehicle_flags
Used for gradual loading and other miscellaneous things (.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
static bool HasTileWaterClass(TileIndex t)
Checks whether the tile has an waterclass associated.
Functions related to NewGRF provided sounds.
DiagDirection
Enumeration for diagonal directions.
Base functions for all AIs.
Track NPFShipChooseTrack(const Ship *v, bool &path_found)
Finds the best path for given ship using NPF.
byte progress
The percentage (if divided by 256) this vehicle already crossed the tile unit.
The vehicle cannot enter the tile.
Specification of a rectangle with absolute coordinates of all edges.
uint16 GetMaxSpeed() const
Get the maxmimum speed in km-ish/h a vehicle is allowed to reach on the way to the destination...
static Industry * GetByTile(TileIndex tile)
Get the industry of the given tile.
virtual bool IsChainInDepot() const
Check whether the whole vehicle chain is in the depot.
Window functions not directly related to making/drawing windows.
static DiagDirection AxisToDiagDir(Axis a)
Converts an Axis to a DiagDirection.
uint8 pathfinder_for_ships
the pathfinder to use for ships
One direction is the opposite of the other one.
#define TILE_ADD(x, y)
Adds to tiles together.
Money profit_this_year
Profit this year << 8, low 8 bits are fract.
void SetWindowClassesDirty(WindowClass cls)
Mark all windows of a particular class as dirty (in need of repainting)
uint DetermineCapacity(const Vehicle *v, uint16 *mail_capacity=nullptr) const
Determines capacity of a given vehicle from scratch.
Functions related to news.
Base classes/functions for stations.
CommandCost CmdBuildShip(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **ret)
Build a ship.
VehicleCache vcache
Cache of often used vehicle values.
static Station * Get(size_t index)
Gets station with given index.
Date _date
Current date in days (day counter)
static Direction ReverseDir(Direction d)
Return the reverse of a direction.
TileIndex new_tile
Tile of the vehicle after moving.
bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse)
Find the closest depot for this vehicle and tell us the location, DestinationID and whether we should...
CompanyID _local_company
Company controlled by the human player at this client. Can also be COMPANY_SPECTATOR.
This depot order is because of the servicing limit.
void HandleLoading(bool mode=false)
Handle the loading of the vehicle; when not it skips through dummy orders and does nothing in all oth...
bool NPFShipCheckReverse(const Ship *v)
Returns true if it is better to reverse the ship before leaving depot using NPF.
Axis
Allow incrementing of DiagDirDiff variables.
uint GetOldAdvanceSpeed(uint speed)
Determines the effective direction-specific vehicle movement speed.
void GetBounds(Rect *bounds) const
Determine shared bounds of all sprites.
Date GetLifeLengthInDays() const
Returns the vehicle's (not model's!) life length in days.
byte day_counter
Increased by one for each day.
Order current_order
The current order (+ status, like: loading)
static Direction DiagDirToDir(DiagDirection dir)
Convert a DiagDirection to a Direction.
void UpdateVisualEffect(bool allow_power_change=true)
Update the cached visual effect.
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-...
Money GetRunningCost() const
Gets the running cost of a vehicle.
int16 rotation_x_pos
NOSAVE: X Position before rotation.
SpriteID colourmap
NOSAVE: cached colour mapping.
static Track ChooseShipTrack(Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks)
Runs the pathfinder to choose a track to continue along.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.
Ship()
We don't want GCC to zero our struct! It already is zeroed and has an index!
static void AddVehicleNewsItem(StringID string, NewsType type, VehicleID vehicle, StationID station=INVALID_STATION)
Adds a newsitem referencing a vehicle.