OpenTTD
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
station_cmd.cpp File Reference

Handling of station tiles. More...

#include "stdafx.h"
#include "aircraft.h"
#include "bridge_map.h"
#include "cmd_helper.h"
#include "viewport_func.h"
#include "command_func.h"
#include "town.h"
#include "news_func.h"
#include "train.h"
#include "ship.h"
#include "roadveh.h"
#include "industry.h"
#include "newgrf_cargo.h"
#include "newgrf_debug.h"
#include "newgrf_station.h"
#include "newgrf_canal.h"
#include "pathfinder/yapf/yapf_cache.h"
#include "road_internal.h"
#include "autoslope.h"
#include "water.h"
#include "strings_func.h"
#include "clear_func.h"
#include "date_func.h"
#include "vehicle_func.h"
#include "string_func.h"
#include "animated_tile_func.h"
#include "elrail_func.h"
#include "station_base.h"
#include "roadstop_base.h"
#include "newgrf_railtype.h"
#include "waypoint_base.h"
#include "waypoint_func.h"
#include "pbs.h"
#include "debug.h"
#include "core/random_func.hpp"
#include "company_base.h"
#include "table/airporttile_ids.h"
#include "newgrf_airporttiles.h"
#include "order_backup.h"
#include "newgrf_house.h"
#include "company_gui.h"
#include "linkgraph/linkgraph_base.h"
#include "linkgraph/refresh.h"
#include "widgets/station_widget.h"
#include "table/strings.h"
#include "safeguards.h"
#include "table/station_land.h"

Go to the source code of this file.

Data Structures

struct  StationNameInformation
 Information to handle station action 0 property 24 correctly. More...
 

Macros

#define M(x)   ((x) - STR_SV_STNAME)
 

Typedefs

typedef bool(* CMSAMatcher) (TileIndex tile)
 Function to check whether the given tile matches some criterion. More...
 

Enumerations

enum  StationNaming {
  STATIONNAMING_RAIL, STATIONNAMING_ROAD, STATIONNAMING_AIRPORT, STATIONNAMING_OILRIG,
  STATIONNAMING_DOCK, STATIONNAMING_HELIPORT
}
 

Functions

bool IsHangar (TileIndex t)
 Check whether the given tile is a hangar. More...
 
template<class T >
CommandCost GetStationAround (TileArea ta, StationID closest_station, T **st)
 Look for a station around the given tile area. More...
 
static int CountMapSquareAround (TileIndex tile, CMSAMatcher cmp)
 Counts the numbers of tiles matching a specific type in the area around. More...
 
static bool CMSAMine (TileIndex tile)
 Check whether the tile is a mine. More...
 
static bool CMSAWater (TileIndex tile)
 Check whether the tile is water. More...
 
static bool CMSATree (TileIndex tile)
 Check whether the tile is a tree. More...
 
static bool FindNearIndustryName (TileIndex tile, void *user_data)
 Find a station action 0 property 24 station name, or reduce the free_names if needed. More...
 
static StringID GenerateStationName (Station *st, TileIndex tile, StationNaming name_class)
 
static StationGetClosestDeletedStation (TileIndex tile)
 Find the closest deleted station of the current company. More...
 
void UpdateAllStationVirtCoords ()
 Update the virtual coords needed to draw the station sign for all stations. More...
 
static uint GetAcceptanceMask (const Station *st)
 Get a mask of the cargo types that the station accepts. More...
 
static void ShowRejectOrAcceptNews (const Station *st, uint num_items, CargoID *cargo, StringID msg)
 Items contains the two cargo names that are to be accepted or rejected. More...
 
CargoArray GetProductionAroundTiles (TileIndex tile, int w, int h, int rad)
 Get the cargo types being produced around the tile (in a rectangle). More...
 
CargoArray GetAcceptanceAroundTiles (TileIndex tile, int w, int h, int rad, uint32 *always_accepted)
 Get the acceptance of cargoes around the tile in 1/8. More...
 
void UpdateStationAcceptance (Station *st, bool show_msg)
 Update the acceptance for a station. More...
 
static void UpdateStationSignCoord (BaseStation *st)
 
static CommandCost BuildStationPart (Station **st, DoCommandFlag flags, bool reuse, TileArea area, StationNaming name_class)
 Common part of building various station parts and possibly attaching them to an existing one. More...
 
static void DeleteStationIfEmpty (BaseStation *st)
 This is called right after a station was deleted. More...
 
CommandCost ClearTile_Station (TileIndex tile, DoCommandFlag flags)
 Clear a single tile of a station. More...
 
CommandCost CheckBuildableTile (TileIndex tile, uint invalid_dirs, int &allowed_z, bool allow_steep, bool check_bridge=true)
 Checks if the given tile is buildable, flat and has a certain height. More...
 
CommandCost CheckFlatLand (TileArea tile_area, DoCommandFlag flags)
 Tries to clear the given area. More...
 
static CommandCost CheckFlatLandRailStation (TileArea tile_area, DoCommandFlag flags, Axis axis, StationID *station, RailType rt, SmallVector< Train *, 4 > &affected_vehicles, StationClassID spec_class, byte spec_index, byte plat_len, byte numtracks)
 Checks if a rail station can be built at the given area. More...
 
static CommandCost CheckFlatLandRoadStop (TileArea tile_area, DoCommandFlag flags, uint invalid_dirs, bool is_drive_through, bool is_truck_stop, Axis axis, StationID *station, RoadTypes rts)
 Checks if a road stop can be built at the given tile. More...
 
CommandCost CanExpandRailStation (const BaseStation *st, TileArea &new_ta, Axis axis)
 Check whether we can expand the rail part of the given station. More...
 
static byte * CreateSingle (byte *layout, int n)
 
static byte * CreateMulti (byte *layout, int n, byte b)
 
void GetStationLayout (byte *layout, int numtracks, int plat_len, const StationSpec *statspec)
 Create the station layout for the given number of tracks and platform length. More...
 
template<class T , StringID error_message>
CommandCost FindJoiningBaseStation (StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, T **st)
 Find a nearby station that joins this station. More...
 
static CommandCost FindJoiningStation (StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, Station **st)
 Find a nearby station that joins this station. More...
 
CommandCost FindJoiningWaypoint (StationID existing_waypoint, StationID waypoint_to_join, bool adjacent, TileArea ta, Waypoint **wp)
 Find a nearby waypoint that joins this waypoint. More...
 
static void FreeTrainReservation (Train *v)
 Clear platform reservation during station building/removing. More...
 
static void RestoreTrainReservation (Train *v)
 Restore platform reservation during station building/removing. More...
 
CommandCost CmdBuildRailStation (TileIndex tile_org, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 Build rail station. More...
 
static void MakeRailStationAreaSmaller (BaseStation *st)
 
template<class T >
CommandCost RemoveFromRailBaseStation (TileArea ta, SmallVector< T *, 4 > &affected_stations, DoCommandFlag flags, Money removal_cost, bool keep_rail)
 Remove a number of tiles from any rail station within the area. More...
 
CommandCost CmdRemoveFromRailStation (TileIndex start, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 Remove a single tile from a rail station. More...
 
CommandCost CmdRemoveFromRailWaypoint (TileIndex start, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 Remove a single tile from a waypoint. More...
 
template<class T >
CommandCost RemoveRailStation (T *st, DoCommandFlag flags, Money removal_cost)
 Remove a rail station/waypoint. More...
 
static CommandCost RemoveRailStation (TileIndex tile, DoCommandFlag flags)
 Remove a rail station. More...
 
static CommandCost RemoveRailWaypoint (TileIndex tile, DoCommandFlag flags)
 Remove a rail waypoint. More...
 
static RoadStop ** FindRoadStopSpot (bool truck_station, Station *st)
 
static CommandCost RemoveRoadStop (TileIndex tile, DoCommandFlag flags)
 Remove a bus station/truck stop. More...
 
static CommandCost FindJoiningRoadStop (StationID existing_stop, StationID station_to_join, bool adjacent, TileArea ta, Station **st)
 Find a nearby station that joins this road stop. More...
 
CommandCost CmdBuildRoadStop (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 Build a bus or truck stop. More...
 
static VehicleClearRoadStopStatusEnum (Vehicle *v, void *)
 
CommandCost CmdRemoveRoadStop (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 Remove bus or truck stops. More...
 
static uint GetMinimalAirportDistanceToTile (TileIterator &it, TileIndex town_tile)
 Computes the minimal distance from town's xy to any airport's tile. More...
 
uint8 GetAirportNoiseLevelForTown (const AirportSpec *as, TileIterator &it, TileIndex town_tile)
 Get a possible noise reduction factor based on distance from town center. More...
 
TownAirportGetNearestTown (const AirportSpec *as, const TileIterator &it)
 Finds the town nearest to given airport. More...
 
void UpdateAirportsNoise ()
 Recalculate the noise generated by the airports of each town.
 
CommandCost CmdBuildAirport (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 Place an Airport. More...
 
static CommandCost RemoveAirport (TileIndex tile, DoCommandFlag flags)
 Remove an airport. More...
 
CommandCost CmdOpenCloseAirport (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 Open/close an airport to incoming aircraft. More...
 
bool HasStationInUse (StationID station, bool include_company, CompanyID company)
 Tests whether the company's vehicles have this station in orders. More...
 
CommandCost CmdBuildDock (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 Build a dock/haven. More...
 
static CommandCost RemoveDock (TileIndex tile, DoCommandFlag flags)
 Remove a dock. More...
 
const DrawTileSpritesGetStationTileLayout (StationType st, byte gfx)
 
bool SplitGroundSpriteForOverlay (const TileInfo *ti, SpriteID *ground, RailTrackOffset *overlay_offset)
 Check whether a sprite is a track sprite, which can be replaced by a non-track ground sprite and a rail overlay. More...
 
static void DrawTile_Station (TileInfo *ti)
 
void StationPickerDrawSprite (int x, int y, StationType st, RailType railtype, RoadType roadtype, int image)
 
static int GetSlopePixelZ_Station (TileIndex tile, uint x, uint y)
 
static Foundation GetFoundation_Station (TileIndex tile, Slope tileh)
 
static void GetTileDesc_Station (TileIndex tile, TileDesc *td)
 
static TrackStatus GetTileTrackStatus_Station (TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
 
static void TileLoop_Station (TileIndex tile)
 
static void AnimateTile_Station (TileIndex tile)
 
static bool ClickTile_Station (TileIndex tile)
 
static VehicleEnterTileStatus VehicleEnter_Station (Vehicle *v, TileIndex tile, int x, int y)
 
void TriggerWatchedCargoCallbacks (Station *st)
 Run the watched cargo callback for all houses in the catchment area. More...
 
static bool StationHandleBigTick (BaseStation *st)
 This function is called for each station once every 250 ticks. More...
 
static void byte_inc_sat (byte *p)
 
static void TruncateCargo (const CargoSpec *cs, GoodsEntry *ge, uint amount=UINT_MAX)
 Truncate the cargo by a specific amount. More...
 
static void UpdateStationRating (Station *st)
 
void RerouteCargo (Station *st, CargoID c, StationID avoid, StationID avoid2)
 Reroute cargo of type c at station st or in any vehicles unloading there. More...
 
void DeleteStaleLinks (Station *from)
 Check all next hops of cargo packets in this station for existance of a a valid link they may use to travel on. More...
 
void IncreaseStats (Station *st, CargoID cargo, StationID next_station_id, uint capacity, uint usage, EdgeUpdateMode mode)
 Increase capacity for a link stat given by station cargo and next hop. More...
 
void IncreaseStats (Station *st, const Vehicle *front, StationID next_station_id)
 Increase capacity for all link stats associated with vehicles in the given consist. More...
 
static void StationHandleSmallTick (BaseStation *st)
 
void OnTick_Station ()
 
void StationMonthlyLoop ()
 Monthly loop for stations. More...
 
void ModifyStationRatingAround (TileIndex tile, Owner owner, int amount, uint radius)
 
static uint UpdateStationWaiting (Station *st, CargoID type, uint amount, SourceType source_type, SourceID source_id)
 
static bool IsUniqueStationName (const char *name)
 
CommandCost CmdRenameStation (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 Rename a station. More...
 
void FindStationsAroundTiles (const TileArea &location, StationList *stations)
 Find all stations around a rectangular producer (industry, house, headquarter, ...) More...
 
uint MoveGoodsToStation (CargoID type, uint amount, SourceType source_type, SourceID source_id, const StationList *all_stations)
 
void BuildOilRig (TileIndex tile)
 
void DeleteOilRig (TileIndex tile)
 
static void ChangeTileOwner_Station (TileIndex tile, Owner old_owner, Owner new_owner)
 
static bool CanRemoveRoadWithStop (TileIndex tile, DoCommandFlag flags)
 Check if a drive-through road stop tile can be cleared. More...
 
static CommandCost TerraformTile_Station (TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
 

Variables

static const TileIndexDiffC _dock_tileoffs_chkaround []
 
static const byte _dock_w_chk [4] = { 2, 1, 2, 1 }
 
static const byte _dock_h_chk [4] = { 1, 2, 1, 2 }
 
const TileTypeProcs _tile_type_station_procs
 

Detailed Description

Handling of station tiles.

Definition in file station_cmd.cpp.

Typedef Documentation

◆ CMSAMatcher

typedef bool(* CMSAMatcher) (TileIndex tile)

Function to check whether the given tile matches some criterion.

Parameters
tilethe tile to check
Returns
true if it matches, false otherwise

Definition at line 127 of file station_cmd.cpp.

Function Documentation

◆ AirportGetNearestTown()

Town* AirportGetNearestTown ( const AirportSpec as,
const TileIterator it 
)

Finds the town nearest to given airport.

Based on minimal manhattan distance to any airport's tile. If two towns have the same distance, town with lower index is returned.

Parameters
asairport's description
itAn iterator over all airport tiles
Returns
nearest town to airport

Definition at line 2137 of file station_cmd.cpp.

References AirportSpec::size_x, and AirportSpec::size_y.

Referenced by RemoveAirport().

◆ BuildStationPart()

static CommandCost BuildStationPart ( Station **  st,
DoCommandFlag  flags,
bool  reuse,
TileArea  area,
StationNaming  name_class 
)
static

Common part of building various station parts and possibly attaching them to an existing one.

Parameters
[in,out]stStation to attach to
flagsCommand flags
reuseWhether to try to reuse a deleted station (gray sign) if possible
areaArea occupied by the new part
name_classStation naming class to use to generate the new station's name
Returns
Command error that occurred, if any

Definition at line 672 of file station_cmd.cpp.

References _current_company, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_station_pool >::CanAllocateItem(), ClosestTownFromTile(), DC_EXEC, CommandCost::Failed(), GetClosestDeletedStation(), OrthogonalTileArea::h, return_cmd_error, OrthogonalTileArea::tile, and OrthogonalTileArea::w.

◆ CanExpandRailStation()

CommandCost CanExpandRailStation ( const BaseStation st,
TileArea new_ta,
Axis  axis 
)

Check whether we can expand the rail part of the given station.

Parameters
stthe station to expand
new_tathe current (and if all is fine new) tile area of the rail part of the station
axisthe axis of the newly build rail
Returns
Succeeded or failed command.

Definition at line 1000 of file station_cmd.cpp.

References BaseStation::train_station.

◆ CanRemoveRoadWithStop()

static bool CanRemoveRoadWithStop ( TileIndex  tile,
DoCommandFlag  flags 
)
static

Check if a drive-through road stop tile can be cleared.

Road stops built on town-owned roads check the conditions that would allow clearing of the original road.

Parameters
tileroad stop tile to check
flagscommand flags
Returns
true if the road can be cleared

Definition at line 4036 of file station_cmd.cpp.

References _current_company, CheckAllowRemoveRoad(), CheckOwnership(), GetAnyRoadBits(), GetRoadOwner(), GetRoadTypes(), HasBit(), OWNER_NONE, OWNER_TOWN, OWNER_WATER, ROADTYPE_ROAD, and ROADTYPE_TRAM.

◆ CheckBuildableTile()

CommandCost CheckBuildableTile ( TileIndex  tile,
uint  invalid_dirs,
int &  allowed_z,
bool  allow_steep,
bool  check_bridge = true 
)

Checks if the given tile is buildable, flat and has a certain height.

Parameters
tileTileIndex to check.
invalid_dirsProhibited directions for slopes (set of DiagDirection).
allowed_zHeight allowed for the tile. If allowed_z is negative, it will be set to the height of this tile.
allow_steepWhether steep slopes are allowed.
check_bridgeCheck for the existence of a bridge.
Returns
The cost in case of success, or an error code if it failed.

Definition at line 729 of file station_cmd.cpp.

References _settings_game, CommandCost::AddCost(), ConstructionSettings::build_on_slopes, CanBuildDepotByTileh(), GameSettings::construction, DIAGDIR_BEGIN, DIAGDIR_END, EnsureNoVehicleOnGround(), EXPENSES_CONSTRUCTION, CommandCost::Failed(), GetSlopeMaxZ(), GetTileSlope(), HasBit(), IsBridgeAbove(), IsSteepSlope(), return_cmd_error, and SLOPE_FLAT.

Referenced by CheckFlatLand(), CheckFlatLandRailStation(), and CheckFlatLandRoadStop().

◆ CheckFlatLand()

CommandCost CheckFlatLand ( TileArea  tile_area,
DoCommandFlag  flags 
)

Tries to clear the given area.

Parameters
tile_areaArea to check.
flagsOperation to perform.
Returns
The cost in case of success, or an error code if it failed.

Definition at line 779 of file station_cmd.cpp.

References CommandCost::AddCost(), CheckBuildableTile(), CMD_LANDSCAPE_CLEAR, DoCommand(), EXPENSES_CONSTRUCTION, CommandCost::Failed(), and TILE_AREA_LOOP.

◆ CheckFlatLandRailStation()

static CommandCost CheckFlatLandRailStation ( TileArea  tile_area,
DoCommandFlag  flags,
Axis  axis,
StationID *  station,
RailType  rt,
SmallVector< Train *, 4 > &  affected_vehicles,
StationClassID  spec_class,
byte  spec_index,
byte  plat_len,
byte  numtracks 
)
static

Checks if a rail station can be built at the given area.

Parameters
tile_areaArea to check.
flagsOperation to perform.
axisRail station axis.
stationStationID to be queried and returned if available.
rtThe rail type to check for (overbuilding rail stations over rail).
affected_vehiclesList of trains with PBS reservations on the tiles
spec_classStation class.
spec_indexIndex into the station class.
plat_lenPlatform length.
numtracksNumber of platforms.
Returns
The cost in case of success, or an error code if it failed.

Definition at line 811 of file station_cmd.cpp.

References CommandCost::AddCost(), StationSpec::callback_mask, CBM_STATION_SLOPE_CHECK, CheckBuildableTile(), ClearTile_Station(), DC_AUTO, EXPENSES_CONSTRUCTION, CommandCost::Failed(), NewGRFClass< Tspec, Tid, Tmax >::Get(), GetStationIndex(), HasBit(), IsRailStation(), IsTileType(), MP_STATION, PerformStationTileSlopeCheck(), OrthogonalTileArea::tile, and TILE_AREA_LOOP.

◆ CheckFlatLandRoadStop()

static CommandCost CheckFlatLandRoadStop ( TileArea  tile_area,
DoCommandFlag  flags,
uint  invalid_dirs,
bool  is_drive_through,
bool  is_truck_stop,
Axis  axis,
StationID *  station,
RoadTypes  rts 
)
static

Checks if a road stop can be built at the given tile.

Parameters
tile_areaArea to check.
flagsOperation to perform.
invalid_dirsProhibited directions (set of DiagDirections).
is_drive_throughTrue if trying to build a drive-through station.
is_truck_stopTrue when building a truck stop, false otherwise.
axisAxis of a drive-through road stop.
stationStationID to be queried and returned if available.
rtsRoad types to build.
Returns
The cost in case of success, or an error code if it failed.

Definition at line 897 of file station_cmd.cpp.

References CommandCost::AddCost(), CheckBuildableTile(), ClearTile_Station(), DC_AUTO, DiagDirToAxis(), EXPENSES_CONSTRUCTION, CommandCost::Failed(), GetRoadStopDir(), GetStationIndex(), IsDriveThroughStopTile(), IsRoadStop(), IsTileType(), IsTruckStop(), MP_STATION, return_cmd_error, and TILE_AREA_LOOP.

◆ ClearTile_Station()

CommandCost ClearTile_Station ( TileIndex  tile,
DoCommandFlag  flags 
)

Clear a single tile of a station.

Parameters
tileThe tile to clear.
flagsThe DoCommand flags related to the "command".
Returns
The cost, or error of clearing.

Definition at line 4064 of file station_cmd.cpp.

References DC_AUTO, and GetStationType().

Referenced by CheckFlatLandRailStation(), CheckFlatLandRoadStop(), GetAxisForNewWaypoint(), and IsValidTileForWaypoint().

◆ CmdBuildAirport()

CommandCost CmdBuildAirport ( TileIndex  tile,
DoCommandFlag  flags,
uint32  p1,
uint32  p2,
const char *  text 
)

Place an Airport.

Parameters
tiletile where airport will be built
flagsoperation to perform
p1
  • p1 = (bit 0- 7) - airport type,
See also
airport.h
  • p1 = (bit 8-15) - airport layout
Parameters
p2various bitstuffed elements
  • p2 = (bit 0) - allow airports directly adjacent to other airports.
  • p2 = (bit 16-31) - station ID to join (NEW_STATION if build new one)
textunused
Returns
the cost of this operation or an error

Definition at line 2189 of file station_cmd.cpp.

References GB().

◆ CmdBuildDock()

CommandCost CmdBuildDock ( TileIndex  tile,
DoCommandFlag  flags,
uint32  p1,
uint32  p2,
const char *  text 
)

Build a dock/haven.

Parameters
tiletile where dock will be built
flagsoperation to perform
p1(bit 0) - allow docks directly adjacent to other docks.
p2bit 16-31: station ID to join (NEW_STATION if build new one)
textunused
Returns
the cost of this operation or an error

Definition at line 2468 of file station_cmd.cpp.

References GB().

◆ CmdBuildRailStation()

CommandCost CmdBuildRailStation ( TileIndex  tile_org,
DoCommandFlag  flags,
uint32  p1,
uint32  p2,
const char *  text 
)

Build rail station.

Parameters
tile_orgnorthern most position of station dragging/placement
flagsoperation to perform
p1various bitstuffed elements
  • p1 = (bit 0- 3) - railtype
  • p1 = (bit 4) - orientation (Axis)
  • p1 = (bit 8-15) - number of tracks
  • p1 = (bit 16-23) - platform length
  • p1 = (bit 24) - allow stations directly adjacent to other stations.
p2various bitstuffed elements
  • p2 = (bit 0- 7) - custom station class
  • p2 = (bit 8-15) - custom station id
  • p2 = (bit 16-31) - station ID to join (NEW_STATION if build new one)
textunused
Returns
the cost of this operation or an error

Definition at line 1186 of file station_cmd.cpp.

References AXIS_X, CheckIfAuthorityAllowsNewStation(), CMD_ERROR, CommandCost::Failed(), GB(), NewGRFClass< Tspec, Tid, Tmax >::Get(), NewGRFClass< Tspec, Tid, Tmax >::GetSpecCount(), HasBit(), STAT_CLASS_WAYP, and ValParamRailtype().

◆ CmdBuildRoadStop()

CommandCost CmdBuildRoadStop ( TileIndex  tile,
DoCommandFlag  flags,
uint32  p1,
uint32  p2,
const char *  text 
)

Build a bus or truck stop.

Parameters
tileNorthernmost tile of the stop.
flagsOperation to perform.
p1bit 0..7: Width of the road stop. bit 8..15: Length of the road stop.
p2bit 0: 0 For bus stops, 1 for truck stops. bit 1: 0 For normal stops, 1 for drive-through. bit 2..3: The roadtypes. bit 5: Allow stations directly adjacent to other stations. bit 6..7: Entrance direction (DiagDirection) for normal stops. bit 6: Axis of the road for drive-through stops. bit 16..31: Station ID to join (NEW_STATION if build new one).
textUnused.
Returns
The cost of this operation or an error.

Definition at line 1757 of file station_cmd.cpp.

References GB(), and HasBit().

◆ CmdOpenCloseAirport()

CommandCost CmdOpenCloseAirport ( TileIndex  tile,
DoCommandFlag  flags,
uint32  p1,
uint32  p2,
const char *  text 
)

◆ CmdRemoveFromRailStation()

CommandCost CmdRemoveFromRailStation ( TileIndex  start,
DoCommandFlag  flags,
uint32  p1,
uint32  p2,
const char *  text 
)

Remove a single tile from a rail station.

This allows for custom-built station with holes and weird layouts

Parameters
starttile of station piece to remove
flagsoperation to perform
p1start_tile
p2various bitstuffed elements
  • p2 = bit 0 - if set keep the rail
textunused
Returns
the cost of this operation or an error

Definition at line 1583 of file station_cmd.cpp.

References CMD_ERROR, MapSize(), and RemoveFromRailBaseStation().

◆ CmdRemoveFromRailWaypoint()

CommandCost CmdRemoveFromRailWaypoint ( TileIndex  start,
DoCommandFlag  flags,
uint32  p1,
uint32  p2,
const char *  text 
)

Remove a single tile from a waypoint.

This allows for custom-built waypoint with holes and weird layouts

Parameters
starttile of waypoint piece to remove
flagsoperation to perform
p1start_tile
p2various bitstuffed elements
  • p2 = bit 0 - if set keep the rail
textunused
Returns
the cost of this operation or an error

Definition at line 1618 of file station_cmd.cpp.

References CMD_ERROR, MapSize(), and RemoveFromRailBaseStation().

◆ CmdRemoveRoadStop()

CommandCost CmdRemoveRoadStop ( TileIndex  tile,
DoCommandFlag  flags,
uint32  p1,
uint32  p2,
const char *  text 
)

Remove bus or truck stops.

Parameters
tileNorthernmost tile of the removal area.
flagsOperation to perform.
p1bit 0..7: Width of the removal area. bit 8..15: Height of the removal area.
p2bit 0: 0 For bus stops, 1 for truck stops.
p2bit 1: 0 to keep roads of all drive-through stops, 1 to remove them.
textUnused.
Returns
The cost of this operation or an error.

Definition at line 2015 of file station_cmd.cpp.

◆ CmdRenameStation()

CommandCost CmdRenameStation ( TileIndex  tile,
DoCommandFlag  flags,
uint32  p1,
uint32  p2,
const char *  text 
)

Rename a station.

Parameters
tileunused
flagsoperation to perform
p1station ID that is to be renamed
p2unused
textthe new name or an empty string when resetting to the default
Returns
the cost of this operation or an error

Definition at line 3746 of file station_cmd.cpp.

References CheckOwnership(), CMD_ERROR, CommandCost::Failed(), SpecializedStation< Station, false >::GetIfValid(), MAX_LENGTH_STATION_NAME_CHARS, BaseStation::owner, StrEmpty(), and Utf8StringLength().

◆ CMSAMine()

static bool CMSAMine ( TileIndex  tile)
static

Check whether the tile is a mine.

Parameters
tilethe tile to investigate.
Returns
true if and only if the tile is a mine

Definition at line 154 of file station_cmd.cpp.

References CC_LIQUID, CC_MAIL, CC_PASSENGERS, CargoSpec::classes, CT_INVALID, CargoSpec::Get(), Industry::GetByTile(), GetIndustrySpec(), INDUSTRYLIFE_EXTRACTIVE, IsTileType(), lengthof, IndustrySpec::life_type, MP_INDUSTRY, Industry::produced_cargo, and Industry::type.

◆ CMSATree()

static bool CMSATree ( TileIndex  tile)
static

Check whether the tile is a tree.

Parameters
tilethe tile to investigate.
Returns
true if and only if the tile is a tree tile

Definition at line 191 of file station_cmd.cpp.

References IsTileType(), and MP_TREES.

◆ CMSAWater()

static bool CMSAWater ( TileIndex  tile)
static

Check whether the tile is water.

Parameters
tilethe tile to investigate.
Returns
true if and only if the tile is a water tile

Definition at line 181 of file station_cmd.cpp.

References IsTileType(), IsWater(), and MP_WATER.

◆ CountMapSquareAround()

static int CountMapSquareAround ( TileIndex  tile,
CMSAMatcher  cmp 
)
static

Counts the numbers of tiles matching a specific type in the area around.

Parameters
tilethe center tile of the 'count area'
cmpthe comparator/matcher (
See also
CMSAMatcher)
Returns
the number of matching tiles around

Definition at line 135 of file station_cmd.cpp.

References INVALID_TILE, and TileAddWrap().

◆ DeleteStaleLinks()

void DeleteStaleLinks ( Station from)

Check all next hops of cargo packets in this station for existance of a a valid link they may use to travel on.

Reroute any cargo not having a valid link and remove timed out links found like this from the linkgraph. We're not all links here as that is expensive and useless. A link no one is using doesn't hurt either.

Parameters
fromStation to check.

Definition at line 3451 of file station_cmd.cpp.

References _settings_game, LinkGraph::Node::Begin(), DT_MANUAL, LinkGraph::Node::End(), SpecializedStation< Station, false >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_link_graph_pool >::GetIfValid(), Station::goods, GoodsEntry::link_graph, GameSettings::linkgraph, GoodsEntry::node, and NUM_CARGO.

◆ DeleteStationIfEmpty()

static void DeleteStationIfEmpty ( BaseStation st)
static

This is called right after a station was deleted.

It checks if the whole station is free of substations, and if so, the station will be deleted after a little while.

Parameters
stStation

Definition at line 708 of file station_cmd.cpp.

References BaseStation::delete_ctr, InvalidateWindowData(), BaseStation::IsInUse(), BaseStation::owner, and WC_STATION_LIST.

◆ FindJoiningBaseStation()

template<class T , StringID error_message>
CommandCost FindJoiningBaseStation ( StationID  existing_station,
StationID  station_to_join,
bool  adjacent,
TileArea  ta,
T **  st 
)

Find a nearby station that joins this station.

Template Parameters
Tthe class to find a station for
error_messagethe error message when building a station on top of others
Parameters
existing_stationan existing station we build over
station_to_jointhe station to join to
adjacentwhether adjacent stations are allowed
tathe area of the newly build station
st'return' pointer for the found station
Returns
command cost with the error or 'okay'

Definition at line 1081 of file station_cmd.cpp.

◆ FindJoiningRoadStop()

static CommandCost FindJoiningRoadStop ( StationID  existing_stop,
StationID  station_to_join,
bool  adjacent,
TileArea  ta,
Station **  st 
)
static

Find a nearby station that joins this road stop.

Parameters
existing_stopan existing road stop we build over
station_to_jointhe station to join to
adjacentwhether adjacent stations are allowed
tathe area of the newly build station
st'return' pointer for the found station
Returns
command cost with the error or 'okay'

Definition at line 1736 of file station_cmd.cpp.

◆ FindJoiningStation()

static CommandCost FindJoiningStation ( StationID  existing_station,
StationID  station_to_join,
bool  adjacent,
TileArea  ta,
Station **  st 
)
static

Find a nearby station that joins this station.

Parameters
existing_stationan existing station we build over
station_to_jointhe station to join to
adjacentwhether adjacent stations are allowed
tathe area of the newly build station
st'return' pointer for the found station
Returns
command cost with the error or 'okay'

Definition at line 1126 of file station_cmd.cpp.

◆ FindJoiningWaypoint()

CommandCost FindJoiningWaypoint ( StationID  existing_waypoint,
StationID  waypoint_to_join,
bool  adjacent,
TileArea  ta,
Waypoint **  wp 
)

Find a nearby waypoint that joins this waypoint.

Parameters
existing_waypointan existing waypoint we build over
waypoint_to_jointhe waypoint to join to
adjacentwhether adjacent waypoints are allowed
tathe area of the newly build waypoint
wp'return' pointer for the found waypoint
Returns
command cost with the error or 'okay'

Definition at line 1140 of file station_cmd.cpp.

◆ FindNearIndustryName()

static bool FindNearIndustryName ( TileIndex  tile,
void *  user_data 
)
static

Find a station action 0 property 24 station name, or reduce the free_names if needed.

Parameters
tilethe tile to search
user_datathe StationNameInformation to base the search on
Returns
true if the tile contains an industry that has not given its name to one of the other stations in town.

Definition at line 221 of file station_cmd.cpp.

References StationNameInformation::free_names, GetIndustrySpec(), GetIndustryType(), IsTileType(), and MP_INDUSTRY.

◆ FindRoadStopSpot()

static RoadStop** FindRoadStopSpot ( bool  truck_station,
Station st 
)
static
Parameters
truck_stationDetermines whether a stop is ROADSTOP_BUS or ROADSTOP_TRUCK
stThe Station to do the whole procedure for
Returns
a pointer to where to link a new RoadStop*

Definition at line 1710 of file station_cmd.cpp.

References Station::bus_stops, RoadStop::next, RemoveRoadStop(), and Station::truck_stops.

◆ FindStationsAroundTiles()

void FindStationsAroundTiles ( const TileArea location,
StationList stations 
)

Find all stations around a rectangular producer (industry, house, headquarter, ...)

Parameters
locationThe location/area of the producer
stationsThe list to store the stations in

Definition at line 3778 of file station_cmd.cpp.

References _settings_game, CA_UNMODIFIED, MAX_CATCHMENT, StationSettings::modified_catchment, and GameSettings::station.

Referenced by StationFinder::GetStations(), and WhoCanServiceIndustry().

◆ FreeTrainReservation()

static void FreeTrainReservation ( Train v)
static

Clear platform reservation during station building/removing.

Parameters
vvehicle which holds reservation

Definition at line 1149 of file station_cmd.cpp.

References FreeTrainTrackReservation(), Train::GetVehicleTrackdir(), IsRailStationTile(), SpecializedVehicle< T, Type >::Last(), ReverseTrackdir(), SetRailStationPlatformReservation(), Vehicle::tile, and TrackdirToExitdir().

◆ GetAcceptanceAroundTiles()

CargoArray GetAcceptanceAroundTiles ( TileIndex  tile,
int  w,
int  h,
int  rad,
uint32 *  always_accepted 
)

Get the acceptance of cargoes around the tile in 1/8.

Parameters
tileCenter of the search area
wX extent of area
hY extent of area
radSearch radius in addition to given area
always_acceptedbitmask of cargo accepted by houses and headquarters; can be NULL

Definition at line 527 of file station_cmd.cpp.

Referenced by UpdateStationAcceptance().

◆ GetAcceptanceMask()

static uint GetAcceptanceMask ( const Station st)
static

Get a mask of the cargo types that the station accepts.

Parameters
stStation to query
Returns
the expected mask

Definition at line 443 of file station_cmd.cpp.

References GoodsEntry::GES_ACCEPTANCE, Station::goods, HasBit(), NUM_CARGO, and GoodsEntry::status.

Referenced by UpdateStationAcceptance().

◆ GetAirportNoiseLevelForTown()

uint8 GetAirportNoiseLevelForTown ( const AirportSpec as,
TileIterator it,
TileIndex  town_tile 
)

Get a possible noise reduction factor based on distance from town center.

The further you get, the less noise you generate. So all those folks at city council can now happily slee... work in their offices

Parameters
asairport information
itAn iterator over all airport tiles.
town_tileTileIndex of town's center, the one who will receive the airport's candidature
Returns
the noise that will be generated, according to distance

Definition at line 2107 of file station_cmd.cpp.

References _settings_game, GameSettings::difficulty, GetMinimalAirportDistanceToTile(), AirportSpec::noise_level, and DifficultySettings::town_council_tolerance.

Referenced by RemoveAirport().

◆ GetClosestDeletedStation()

static Station* GetClosestDeletedStation ( TileIndex  tile)
static

Find the closest deleted station of the current company.

Parameters
tilethe tile to search from.
Returns
the closest station or NULL if too far.

Definition at line 359 of file station_cmd.cpp.

Referenced by BuildStationPart().

◆ GetMinimalAirportDistanceToTile()

static uint GetMinimalAirportDistanceToTile ( TileIterator it,
TileIndex  town_tile 
)
static

Computes the minimal distance from town's xy to any airport's tile.

Parameters
itAn iterator over all airport tiles.
town_tiletown's tile (t->xy)
Returns
minimal manhattan distance from town_tile to any airport's tile

Definition at line 2087 of file station_cmd.cpp.

References DistanceManhattan(), INVALID_TILE, and min().

Referenced by GetAirportNoiseLevelForTown().

◆ GetProductionAroundTiles()

CargoArray GetProductionAroundTiles ( TileIndex  tile,
int  w,
int  h,
int  rad 
)

Get the cargo types being produced around the tile (in a rectangle).

Parameters
tileNorthtile of area
wX extent of the area
hY extent of the area
radSearch radius in addition to the given area

Definition at line 474 of file station_cmd.cpp.

◆ GetStationAround()

template<class T >
CommandCost GetStationAround ( TileArea  ta,
StationID  closest_station,
T **  st 
)

Look for a station around the given tile area.

Parameters
tathe area to search over
closest_stationthe closest station found so far
stto 'return' the found station
Returns
Succeeded command (if zero or one station found) or failed command (for two or more stations found).

Definition at line 99 of file station_cmd.cpp.

◆ GetStationLayout()

void GetStationLayout ( byte *  layout,
int  numtracks,
int  plat_len,
const StationSpec statspec 
)

Create the station layout for the given number of tracks and platform length.

Parameters
layoutThe layout to write to.
numtracksThe number of tracks to write.
plat_lenThe length of the platforms.
statspecThe specification of the station to (possibly) get the layout from.

Definition at line 1045 of file station_cmd.cpp.

◆ HasStationInUse()

bool HasStationInUse ( StationID  station,
bool  include_company,
CompanyID  company 
)

Tests whether the company's vehicles have this station in orders.

Parameters
stationstation ID
include_companyIf true only check vehicles of company, if false only check vehicles of other companies
companycompany ID

Definition at line 2434 of file station_cmd.cpp.

References FOR_ALL_VEHICLES, and Vehicle::owner.

Referenced by RemoveBuoy().

◆ IncreaseStats() [1/2]

void IncreaseStats ( Station st,
CargoID  cargo,
StationID  next_station_id,
uint  capacity,
uint  usage,
EdgeUpdateMode  mode 
)

Increase capacity for a link stat given by station cargo and next hop.

Parameters
stStation to get the link stats from.
cargoCargo to increase stat for.
next_station_idStation the consist will be travelling to next.
capacityCapacity to add to link stat.
usageUsage to add to link stat.
modeUpdate mode to be applied.

Definition at line 3543 of file station_cmd.cpp.

References SpecializedStation< Station, false >::Get(), Station::goods, and GoodsEntry::link_graph.

Referenced by IncreaseStats().

◆ IncreaseStats() [2/2]

void IncreaseStats ( Station st,
const Vehicle front,
StationID  next_station_id 
)

Increase capacity for all link stats associated with vehicles in the given consist.

Parameters
stStation to get the link stats from.
frontFirst vehicle in the consist.
next_station_idStation the consist will be travelling to next.

Definition at line 3595 of file station_cmd.cpp.

References Vehicle::cargo, Vehicle::cargo_type, EUM_INCREASE, IncreaseStats(), min(), Vehicle::Next(), Vehicle::refit_cap, and VehicleCargoList::StoredCount().

◆ IsHangar()

bool IsHangar ( TileIndex  t)

Check whether the given tile is a hangar.

Parameters
tthe tile to of whether it is a hangar.
Precondition
IsTileType(t, MP_STATION)
Returns
true if and only if the tile is a hangar.

Definition at line 74 of file station_cmd.cpp.

Referenced by IsAirportTile(), and IsHangarTile().

◆ RemoveAirport()

static CommandCost RemoveAirport ( TileIndex  tile,
DoCommandFlag  flags 
)
static

◆ RemoveDock()

static CommandCost RemoveDock ( TileIndex  tile,
DoCommandFlag  flags 
)
static

Remove a dock.

Parameters
tileTileIndex been queried
flagsoperation to perform
Returns
cost or failure of operation

Definition at line 2560 of file station_cmd.cpp.

References CheckOwnership(), DC_EXEC, Station::dock_tile, EnsureNoVehicleOnGround(), CommandCost::Failed(), SpecializedStation< Station, false >::GetByTile(), GetDockDirection(), GetDockOffset(), BaseStation::owner, CommandCost::Succeeded(), TILE_ADD, TileOffsByDiagDir(), and ToTileIndexDiff().

◆ RemoveFromRailBaseStation()

template<class T >
CommandCost RemoveFromRailBaseStation ( TileArea  ta,
SmallVector< T *, 4 > &  affected_stations,
DoCommandFlag  flags,
Money  removal_cost,
bool  keep_rail 
)

Remove a number of tiles from any rail station within the area.

Parameters
tathe area to clear station tile from.
affected_stationsthe stations affected.
flagsthe command flags.
removal_costthe cost for removing the tile, including the rail.
keep_railwhether to keep the rail of the station.
Template Parameters
Tthe type of station to remove.
Returns
the number of cleared tiles or an error.

Definition at line 1475 of file station_cmd.cpp.

References CommandCost::AddCost(), EnsureNoVehicleOnGround(), error(), EXPENSES_CONSTRUCTION, CommandCost::Failed(), HasStationTileRail(), and TILE_AREA_LOOP.

Referenced by CmdRemoveFromRailStation(), and CmdRemoveFromRailWaypoint().

◆ RemoveRailStation() [1/2]

template<class T >
CommandCost RemoveRailStation ( T *  st,
DoCommandFlag  flags,
Money  removal_cost 
)

Remove a rail station/waypoint.

Parameters
stThe station/waypoint to remove the rail part from
flagsoperation to perform
removal_costthe cost for removing a tile
Template Parameters
Tthe type of station to remove
Returns
cost or failure of operation

Definition at line 1639 of file station_cmd.cpp.

Referenced by RemoveRailStation(), and RemoveRailWaypoint().

◆ RemoveRailStation() [2/2]

static CommandCost RemoveRailStation ( TileIndex  tile,
DoCommandFlag  flags 
)
static

Remove a rail station.

Parameters
tileTile of the station.
flagsoperation to perform
Returns
cost or failure of operation

Definition at line 1673 of file station_cmd.cpp.

References _current_company, CMD_REMOVE_FROM_RAIL_STATION, DC_EXEC, DoCommand(), SpecializedStation< Station, false >::GetByTile(), OWNER_WATER, and RemoveRailStation().

◆ RemoveRailWaypoint()

static CommandCost RemoveRailWaypoint ( TileIndex  tile,
DoCommandFlag  flags 
)
static

Remove a rail waypoint.

Parameters
tileTile of the waypoint.
flagsoperation to perform
Returns
cost or failure of operation

Definition at line 1694 of file station_cmd.cpp.

References _current_company, CMD_REMOVE_FROM_RAIL_WAYPOINT, DC_EXEC, DoCommand(), SpecializedStation< Waypoint, true >::GetByTile(), OWNER_WATER, and RemoveRailStation().

◆ RemoveRoadStop()

static CommandCost RemoveRoadStop ( TileIndex  tile,
DoCommandFlag  flags 
)
static

Remove a bus station/truck stop.

Parameters
tileTileIndex been queried
flagsoperation to perform
Returns
cost or failure of operation

Definition at line 1907 of file station_cmd.cpp.

References _current_company, Station::bus_stops, CheckOwnership(), CommandCost::Failed(), RoadStop::GetByTile(), SpecializedStation< Station, false >::GetByTile(), IsTruckStop(), BaseStation::owner, OWNER_WATER, ROADSTOP_BUS, ROADSTOP_TRUCK, and Station::truck_stops.

Referenced by FindRoadStopSpot().

◆ RerouteCargo()

void RerouteCargo ( Station st,
CargoID  c,
StationID  avoid,
StationID  avoid2 
)

Reroute cargo of type c at station st or in any vehicles unloading there.

Make sure the cargo's new next hop is neither "avoid" nor "avoid2".

Parameters
stStation to be rerouted at.
cType of cargo.
avoidOriginal next hop of cargo, avoid this.
avoid2Another station to be avoided when rerouting.

Definition at line 3427 of file station_cmd.cpp.

References GoodsEntry::cargo, Vehicle::cargo, Vehicle::cargo_type, Station::goods, Vehicle::Next(), VehicleCargoList::Reroute(), and StationCargoList::Reroute().

◆ RestoreTrainReservation()

static void RestoreTrainReservation ( Train v)
static

Restore platform reservation during station building/removing.

Parameters
vvehicle which held reservation

Definition at line 1161 of file station_cmd.cpp.

References Train::GetVehicleTrackdir(), IsRailStationTile(), SpecializedVehicle< T, Type >::Last(), ReverseTrackdir(), SetRailStationPlatformReservation(), Vehicle::tile, TrackdirToExitdir(), and TryPathReserve().

◆ ShowRejectOrAcceptNews()

static void ShowRejectOrAcceptNews ( const Station st,
uint  num_items,
CargoID cargo,
StringID  msg 
)
static

Items contains the two cargo names that are to be accepted or rejected.

msg is the string id of the message to display.

Definition at line 457 of file station_cmd.cpp.

References AddNewsItem(), CargoSpec::Get(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, NF_INCOLOUR, NF_SMALL, NR_STATION, NT_ACCEPTANCE, and SetDParam().

Referenced by UpdateStationAcceptance().

◆ SplitGroundSpriteForOverlay()

bool SplitGroundSpriteForOverlay ( const TileInfo ti,
SpriteID ground,
RailTrackOffset overlay_offset 
)

Check whether a sprite is a track sprite, which can be replaced by a non-track ground sprite and a rail overlay.

If the ground sprite is suitable, ground is replaced with the new non-track ground sprite, and overlay_offset is set to the overlay to draw.

Parameters
tiPositional info for the tile to decide snowyness etc. May be NULL.
[in,out]groundGroundsprite to draw.
[out]overlay_offsetOverlay to draw.
Returns
true if overlay can be drawn.

Definition at line 2630 of file station_cmd.cpp.

◆ StationHandleBigTick()

static bool StationHandleBigTick ( BaseStation st)
static

This function is called for each station once every 250 ticks.

Not all stations will get the tick at the same time.

Parameters
stthe station receiving the tick.
Returns
true if the station is still valid (wasn't deleted)

Definition at line 3213 of file station_cmd.cpp.

References ClrBit(), BaseStation::delete_ctr, SpecializedStation< Station, false >::From(), SpecializedStation< Station, false >::IsExpected(), BaseStation::IsInUse(), NUM_CARGO, and TriggerWatchedCargoCallbacks().

◆ StationMonthlyLoop()

void StationMonthlyLoop ( )

Monthly loop for stations.

Definition at line 3649 of file station_cmd.cpp.

◆ TriggerWatchedCargoCallbacks()

void TriggerWatchedCargoCallbacks ( Station st)

Run the watched cargo callback for all houses in the catchment area.

Parameters
stStation.

Definition at line 3186 of file station_cmd.cpp.

References GoodsEntry::GES_ACCEPTED_BIGTICK, Station::GetCatchmentRect(), Station::goods, HasBit(), IsTileType(), MP_HOUSE, NUM_CARGO, SetBit(), GoodsEntry::status, TILE_AREA_LOOP, TileXY(), and WatchedCargoCallback().

Referenced by StationHandleBigTick().

◆ TruncateCargo()

static void TruncateCargo ( const CargoSpec cs,
GoodsEntry ge,
uint  amount = UINT_MAX 
)
static

Truncate the cargo by a specific amount.

Parameters
csThe type of cargo to perform the truncation for.
geThe goods entry, of the station, to truncate.
amountThe amount to truncate the cargo by.

Definition at line 3246 of file station_cmd.cpp.

References GoodsEntry::cargo, SpecializedStation< Station, false >::GetIfValid(), Station::goods, CargoSpec::Index(), max(), GoodsEntry::max_waiting_cargo, and StationCargoList::Truncate().

◆ UpdateAllStationVirtCoords()

void UpdateAllStationVirtCoords ( )

Update the virtual coords needed to draw the station sign for all stations.

Definition at line 429 of file station_cmd.cpp.

Referenced by CmdRenameTown(), and UpdateAllVirtCoords().

◆ UpdateStationAcceptance()

void UpdateStationAcceptance ( Station st,
bool  show_msg 
)

Variable Documentation

◆ _dock_tileoffs_chkaround

const TileIndexDiffC _dock_tileoffs_chkaround[]
static
Initial value:
= {
{-1, 0},
{ 0, 0},
{ 0, 0},
{ 0, -1}
}

Definition at line 2450 of file station_cmd.cpp.

◆ _tile_type_station_procs

const TileTypeProcs _tile_type_station_procs
Initial value:
= {
DrawTile_Station,
GetSlopePixelZ_Station,
NULL,
GetTileDesc_Station,
GetTileTrackStatus_Station,
ClickTile_Station,
AnimateTile_Station,
TileLoop_Station,
ChangeTileOwner_Station,
NULL,
VehicleEnter_Station,
GetFoundation_Station,
TerraformTile_Station,
}
CommandCost ClearTile_Station(TileIndex tile, DoCommandFlag flags)
Clear a single tile of a station.