OpenTTD Source: src/waypoint_cmd.cpp File Reference

OpenTTD Source 15.0-RC2

Functions
waypoint_cmd.cpp File Reference

Command Handling for waypoints. More...

`#include "stdafx.h"`
`#include "command_func.h"`
`#include "landscape.h"`
`#include "bridge_map.h"`
`#include "town.h"`
`#include "waypoint_base.h"`
`#include "pathfinder/yapf/yapf_cache.h"`
`#include "pathfinder/water_regions.h"`
`#include "tilehighlight_func.h"`
`#include "strings_func.h"`
`#include "viewport_func.h"`
`#include "viewport_kdtree.h"`
`#include "station_kdtree.h"`
`#include "window_func.h"`
`#include "timer/timer_game_calendar.h"`
`#include "vehicle_func.h"`
`#include "string_func.h"`
`#include "company_func.h"`
`#include "newgrf_debug.h"`
`#include "newgrf_station.h"`
`#include "newgrf_roadstop.h"`
`#include "company_base.h"`
`#include "water.h"`
`#include "company_gui.h"`
`#include "waypoint_cmd.h"`
`#include "landscape_cmd.h"`
`#include "station_layout_type.h"`
`#include "widgets/misc_widget.h"`
`#include "table/strings.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Functions
static Waypoint * | FindDeletedWaypointCloseTo (TileIndex tile, StringID str, CompanyID cid, bool is_road)
| Find a deleted waypoint close to a tile.
Axis | GetAxisForNewRailWaypoint (TileIndex tile)
| Get the axis for a new rail waypoint.
Axis | GetAxisForNewRoadWaypoint (TileIndex tile)
| Get the axis for a new road waypoint.
CommandCost | ClearTile_Station (TileIndex tile, DoCommandFlags flags)
| Clear a single tile of a station.
static CommandCost | IsValidTileForWaypoint (TileIndex tile, Axis axis, StationID *waypoint)
| Check whether the given tile is suitable for a waypoint.
CommandCost | FindJoiningWaypoint (StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, Waypoint **wp, bool is_road)
| Find a nearby waypoint that joins this waypoint.
CommandCost | CanExpandRailStation (const BaseStation *st, TileArea &new_ta)
| Check whether we can expand the rail part of the given station.
CommandCost | CalculateRoadStopCost (TileArea tile_area, DoCommandFlags flags, bool is_drive_through, StationType station_type, const RoadStopSpec *roadstopspec, Axis axis, DiagDirection ddir, StationID *est, RoadType rt, Money unit_cost)
| Calculates cost of new road stops within the area.
CommandCost | IsRailStationBridgeAboveOk (TileIndex tile, const StationSpec *spec, StationType type, StationGfx layout)
| Test if a rail station can be built below a bridge.
CommandCost | RemoveRoadWaypointStop (TileIndex tile, DoCommandFlags flags, int replacement_spec_index)
| Remove a road waypoint.
CommandCost | CmdBuildRailWaypoint (DoCommandFlags flags, TileIndex start_tile, Axis axis, uint8_t width, uint8_t height, StationClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent)
| Convert existing rail to waypoint.
CommandCost | CmdBuildRoadWaypoint (DoCommandFlags flags, TileIndex start_tile, Axis axis, uint8_t width, uint8_t height, RoadStopClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent)
| Build a road waypoint on an existing road.
CommandCost | CmdBuildBuoy (DoCommandFlags flags, TileIndex tile)
| Build a buoy.
CommandCost | RemoveBuoy (TileIndex tile, DoCommandFlags flags)
| Remove a buoy.
static bool | IsUniqueWaypointName (const std::string &name)
| Check whether the name is unique amongst the waypoints.
CommandCost | CmdRenameWaypoint (DoCommandFlags flags, StationID waypoint_id, const std::string &text)
| Rename a waypoint.
std::tuple< CommandCost, StationID > | CmdMoveWaypointName (DoCommandFlags flags, StationID waypoint_id, TileIndex tile)
| Move a waypoint name.
void | CcMoveWaypointName (Commands, const CommandCost &result, StationID waypoint_id)
| Callback function that is called after a name is moved.

## Detailed Description

Command Handling for waypoints.

Definition in file waypoint_cmd.cpp.

## Function Documentation

## ◆ CalculateRoadStopCost()

CommandCost CalculateRoadStopCost | ( | TileArea | tile_area,
|  | DoCommandFlags | flags,
|  | bool | is_drive_through,
|  | StationType | station_type,
|  | const RoadStopSpec * | roadstopspec,
|  | Axis | axis,
|  | DiagDirection | ddir,
|  | StationID * | est,
|  | RoadType | rt,
|  | Money | unit_cost
| ) |  |
| extern

Calculates cost of new road stops within the area.

Parameters

  tile_area | Area to check.
  flags | Operation to perform.
  is_drive_through | True if trying to build a drive-through station.
  station_type | Station type (bus, truck or road waypoint).
  roadstopspec | Spec of road stop being built.
  axis | Axis of a drive-through road stop.
  ddir | Entrance direction (DiagDirection) for normal stops. Converted to the axis for drive-through stops.
  station | StationID to be queried and returned if available.
  rt | Road type to build, may be INVALID_ROADTYPE if an existing road is required.
  unit_cost | The cost to build one road stop of the current type.

Returns
  The cost in case of success, or an error code if it failed.

Definition at line 2012 of file station_cmd.cpp.

References CommandCost::AddCost(), AxisToDiagDir(), CheckFlatLandRoadStop(), EXPENSES_CONSTRUCTION, CommandCost::Failed(), CommandCost::GetCost(), IsAnyRoadStop(), IsTileType(), MP_STATION, ReverseDiagDir(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set().

Referenced by CmdBuildRoadStop(), and CmdBuildRoadWaypoint().

## ◆ CanExpandRailStation()

CommandCost CanExpandRailStation | ( | const BaseStation * | st,
|  | TileArea & | new_ta
| ) |  |
| extern

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

Parameters

  st | the station to expand
  new_ta | the current (and if all is fine new) tile area of the rail part of the station

Returns
  Succeeded or failed command.

Definition at line 1178 of file station_cmd.cpp.

References _settings_game, OrthogonalTileArea::h, GameSettings::station, StationSettings::station_spread, OrthogonalTileArea::tile, TileX(), TileXY(), TileY(), BaseStation::train_station, and OrthogonalTileArea::w.

Referenced by CmdBuildRailStation(), and CmdBuildRailWaypoint().

## ◆ CcMoveWaypointName()

void CcMoveWaypointName | ( | Commands | cmd,
|  | const CommandCost & | result,
|  | StationID | waypoint_id
| ) |  |

Callback function that is called after a name is moved.

Parameters

  result | of the operation
  waypoint_id | ID of the changed waypoint

Definition at line 657 of file waypoint_cmd.cpp.

References CommandCost::Failed(), SpecializedStation< Waypoint, true >::Get(), ResetObjectToPlace(), and SetViewportCatchmentWaypoint().

Referenced by QueryStringWindow::OnPlaceObject().

## ◆ ClearTile_Station()

CommandCost ClearTile_Station | ( | TileIndex | tile,
|  | DoCommandFlags | flags
| ) |  |
| extern

Clear a single tile of a station.

Parameters

  tile | The tile to clear.
  flags | The DoCommand flags related to the "command".

Returns
  The cost, or error of clearing.

Definition at line 4890 of file station_cmd.cpp.

References Auto, CanRemoveRoadWithStop(), CMD_ERROR, CommandCostWithParam(), CommandCost::Failed(), GetStationType(), HasTileRoadType(), IsDriveThroughStopTile(), RemoveAirport(), RemoveBuoy(), RemoveDock(), RemoveRailStation(), RemoveRailWaypoint(), RemoveRoadStop(), RemoveRoadWaypointStop(), RTT_TRAM, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

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

## ◆ CmdBuildBuoy()

CommandCost CmdBuildBuoy | ( | DoCommandFlags | flags,
|  | TileIndex | tile
| ) |  |

Build a buoy.

Parameters

  flags | operation to perform
  tile | tile where to place the buoy

Returns
  the cost of this operation or an error

Definition at line 474 of file waypoint_cmd.cpp.

References CommandCost::AddCost(), Auto, BaseStation::build_date, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_station_pool >::CanAllocateItem(), CheckForDockingTile(), ClearNeighbourNonFloodingStates(), TimerGameCalendar::date, Dock, Execute, EXPENSES_CONSTRUCTION, BaseStation::facilities, CommandCost::Failed(), FindDeletedWaypointCloseTo(), CommandCost::GetCost(), GetWaterClass(), HasTileWaterGround(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, InvalidateWindowData(), IsBridgeAbove(), IsTileFlat(), IsWaterTile(), MakeBuoy(), MakeDefaultName(), MarkTileDirtyByTile(), BaseStation::owner, OWNER_NONE, BaseStation::rect, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), BaseStation::string_id, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), BaseStation::town, Waypoint::UpdateVirtCoord(), WC_WAYPOINT_VIEW, and BaseStation::xy.

## ◆ CmdBuildRailWaypoint()

CommandCost CmdBuildRailWaypoint | ( | DoCommandFlags | flags,
|  | TileIndex | start_tile,
|  | Axis | axis,
|  | uint8_t | width,
|  | uint8_t | height,
|  | StationClassID | spec_class,
|  | uint16_t | spec_index,
|  | StationID | station_to_join,
|  | bool | adjacent
| ) |  |

Convert existing rail to waypoint.

Eg build a waypoint station over piece of rail

Parameters

  flags | type of operation
  start_tile | northern most tile where waypoint will be built
  axis | orientation (Axis)
  width | width of waypoint
  height | height of waypoint
  spec_class | custom station class
  spec_index | custom station id
  station_to_join | station ID to join (NEW_STATION if build new one)
  adjacent | allow waypoints directly adjacent to other waypoints.

Returns
  the cost of this operation or an error

Definition at line 207 of file waypoint_cmd.cpp.

References _current_company, _settings_game, CommandCost::AddCost(), AllocateSpecToStation(), AssignSpecToStation(), AXIS_X, AxisToTrack(), BaseStation::build_date, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_station_pool >::CanAllocateItem(), CanExpandRailStation(), CMD_ERROR, TimerGameCalendar::date, DeallocateSpecFromStation(), BaseStation::delete_ctr, DeleteNewGRFInspectWindow(), DirtyCompanyInfrastructureWindows(), StationSettings::distant_join_stations, Execute, EXPENSES_CONSTRUCTION, BaseStation::facilities, CommandCost::Failed(), FindDeletedWaypointCloseTo(), FindJoiningWaypoint(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), NewGRFClass< Tspec, Tindex, Tmax >::Get(), NewGRFClass< Tspec, Tindex, Tmax >::GetClassCount(), GetCustomStationSpecIndex(), GetRailReservationTrackBits(), GetRailType(), NewGRFClass< Tspec, Tindex, Tmax >::GetSpec(), NewGRFClass< Tspec, Tindex, Tmax >::GetSpecCount(), GetTileOwner(), HasBit(), HasStationReservation(), HasStationTileRail(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, Company::infrastructure, INVALID_TILE, BaseStation::IsInUse(), IsRailStationBridgeAboveOk(), IsRailWaypointTile(), IsTileType(), IsValidAxis(), SpecializedStation< Waypoint, true >::IsValidID(), IsValidTileForWaypoint(), IsWaypointClass(), MakeDefaultName(), MakeRailWaypoint(), MarkTileDirtyByTile(), MP_RAILWAY, OtherAxis(), BaseStation::owner, BaseStation::rect, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), SetCustomStationSpecIndex(), SetRailStationReservation(), SetRailStationTileFlags(), CompanyInfrastructure::station, GameSettings::station, StationSettings::station_spread, BaseStation::string_id, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), OrthogonalTileArea::tile, TileOffsByAxis(), BaseStation::town, Train, BaseStation::train_station, Waypoint::UpdateVirtCoord(), BaseStation::xy, and YapfNotifyTrackLayoutChange().

## ◆ CmdBuildRoadWaypoint()

CommandCost CmdBuildRoadWaypoint | ( | DoCommandFlags | flags,
|  | TileIndex | start_tile,
|  | Axis | axis,
|  | uint8_t | width,
|  | uint8_t | height,
|  | RoadStopClassID | spec_class,
|  | uint16_t | spec_index,
|  | StationID | station_to_join,
|  | bool | adjacent
| ) |  |

Build a road waypoint on an existing road.

Parameters

  flags | type of operation.
  start_tile | northern most tile where waypoint will be built.
  axis | orientation (Axis).
  width | width of waypoint.
  height | height of waypoint.
  spec_class | custom road stop class.
  spec_index | custom road stop id.
  station_to_join | station ID to join (NEW_STATION if build new one).
  adjacent | allow waypoints directly adjacent to other waypoints.

Returns
  the cost of this operation or an error.

Definition at line 341 of file waypoint_cmd.cpp.

References _current_company, _settings_game, OrthogonalTileArea::Add(), AXIS_X, AxisToDiagDir(), BaseStation::build_date, BusStop, BaseStation::cached_roadstop_anim_triggers, CalculateRoadStopCost(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_station_pool >::CanAllocateItem(), CMD_ERROR, CountBits(), TimerGameCalendar::date, BaseStation::delete_ctr, DirtyCompanyInfrastructureWindows(), StationSettings::distant_join_stations, Execute, BaseStation::facilities, CommandCost::Failed(), FindDeletedWaypointCloseTo(), FindJoiningWaypoint(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), NewGRFClass< Tspec, Tindex, Tmax >::Get(), RoadStopSpec::GetBuildCost(), NewGRFClass< Tspec, Tindex, Tmax >::GetClassCount(), GetRoadBits(), GetRoadOwner(), NewGRFClass< Tspec, Tindex, Tmax >::GetSpec(), NewGRFClass< Tspec, Tindex, Tmax >::GetSpecCount(), HasBit(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, INVALID_ROADTYPE, BaseStation::IsInUse(), IsNormalRoadTile(), IsRoadWaypointTile(), IsValidAxis(), SpecializedStation< Waypoint, true >::IsValidID(), IsWaypointClass(), MakeDefaultName(), MakeDriveThroughRoadStop(), MarkTileDirtyByTile(), MayHaveRoad(), OtherAxis(), BaseStation::owner, BaseStation::rect, RemoveRoadWaypointStop(), ROAD_STOP_TRACKBIT_FACTOR, Waypoint::road_waypoint_area, RTT_ROAD, RTT_TRAM, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), SetBit(), SetCustomRoadStopSpecIndex(), GameSettings::station, StationSettings::station_spread, BaseStation::string_id, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileOffsByAxis(), BaseStation::town, TruckStop, UpdateCompanyRoadInfrastructure(), Waypoint::UpdateVirtCoord(), Waypoint::waypoint_flags, WPF_ROAD, and BaseStation::xy.

## ◆ CmdMoveWaypointName()

std::tuple< CommandCost, StationID > CmdMoveWaypointName | ( | DoCommandFlags | flags,
|  | StationID | waypoint_id,
|  | TileIndex | tile
| ) |  |

Move a waypoint name.

Parameters

  flags | type of operation
  waypoint_id | id of waypoint
  tile | to move the waypoint name to

Returns
  the cost of this operation or an error and the waypoint ID

Definition at line 620 of file waypoint_cmd.cpp.

References CheckOwnership(), CMD_ERROR, Execute, CommandCost::Failed(), ForAllStationsRadius(), SpecializedStation< Waypoint, true >::GetIfValid(), Waypoint::MoveSign(), BaseStation::owner, OWNER_NONE, StationRect::PtInExtendedRect(), BaseStation::rect, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileX(), TileY(), Waypoint::UpdateVirtCoord(), and BaseStation::xy.

## ◆ CmdRenameWaypoint()

CommandCost CmdRenameWaypoint | ( | DoCommandFlags | flags,
|  | StationID | waypoint_id,
|  | const std::string & | text
| ) |  |

Rename a waypoint.

Parameters

  flags | type of operation
  waypoint_id | id of waypoint
  text | the new name or an empty string when resetting to the default

Returns
  the cost of this operation or an error

Definition at line 584 of file waypoint_cmd.cpp.

References CheckOwnership(), CMD_ERROR, Execute, CommandCost::Failed(), SpecializedStation< Waypoint, true >::GetIfValid(), IsUniqueWaypointName(), MAX_LENGTH_STATION_NAME_CHARS, BaseStation::name, BaseStation::owner, OWNER_NONE, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Waypoint::UpdateVirtCoord(), and Utf8StringLength().

## ◆ FindDeletedWaypointCloseTo()

static Waypoint * FindDeletedWaypointCloseTo | ( | TileIndex | tile,
|  | StringID | str,
|  | CompanyID | cid,
|  | bool | is_road
| ) |  |
| static

Find a deleted waypoint close to a tile.

Parameters

  tile | to search from
  str | the string to get the 'type' of
  cid | previous owner of the waypoint
  is_road | whether to find a road waypoint

Returns
  the deleted nearby waypoint

Definition at line 80 of file waypoint_cmd.cpp.

References DistanceManhattan(), HasBit(), SpecializedStation< Waypoint, true >::Iterate(), and WPF_ROAD.

Referenced by CmdBuildBuoy(), CmdBuildRailWaypoint(), and CmdBuildRoadWaypoint().

## ◆ FindJoiningWaypoint()

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

Find a nearby waypoint that joins this waypoint.

Parameters

  existing_waypoint | an existing waypoint we build over
  waypoint_to_join | the waypoint to join to
  adjacent | whether adjacent waypoints are allowed
  ta | the area of the newly build waypoint
  wp | 'return' pointer for the found waypoint
  is_road | whether to find a road waypoint

Returns
  command cost with the error or 'okay'

Definition at line 1302 of file station_cmd.cpp.

References HasBit(), Waypoint::waypoint_flags, and WPF_ROAD.

Referenced by CmdBuildRailWaypoint(), and CmdBuildRoadWaypoint().

## ◆ GetAxisForNewRailWaypoint()

Axis GetAxisForNewRailWaypoint | ( | TileIndex | tile | ) |

Get the axis for a new rail waypoint.

This means that if it is a valid tile to build a waypoint on it returns a valid Axis, otherwise an invalid one.

Parameters

  tile | the tile to look at.

Returns
  the axis for the to-be-build waypoint.

Definition at line 106 of file waypoint_cmd.cpp.

References AXIS_X, AXIS_Y, GetRailStationAxis(), GetRailTileType(), GetTrackBits(), INVALID_AXIS, IsRailWaypointTile(), IsTileType(), MP_RAILWAY, Normal, TRACK_BIT_X, and TRACK_BIT_Y.

Referenced by IsValidTileForWaypoint(), and PlaceRail_Waypoint().

## ◆ GetAxisForNewRoadWaypoint()

Axis GetAxisForNewRoadWaypoint | ( | TileIndex | tile | ) |

Get the axis for a new road waypoint.

This means that if it is a valid tile to build a waypoint on it returns a valid Axis, otherwise an invalid one.

Parameters

  tile | the tile to look at.

Returns
  the axis for the to-be-build waypoint.

Definition at line 128 of file waypoint_cmd.cpp.

References AXIS_X, AXIS_Y, GetAllRoadBits(), GetDriveThroughStopAxis(), INVALID_AXIS, IsNormalRoadTile(), IsRoadWaypointTile(), ROAD_X, and ROAD_Y.

Referenced by PlaceRoad_Waypoint().

## ◆ IsRailStationBridgeAboveOk()

CommandCost IsRailStationBridgeAboveOk | ( | TileIndex | tile,
|  | const StationSpec * | spec,
|  | StationType | type,
|  | StationGfx | layout
| ) |  |
| extern

Test if a rail station can be built below a bridge.

Parameters

  tile | Tile to test.
  spec | Custom station spec to test.
  type | Type of rail station.
  layout | Layout piece of station to test.

Returns
  Command result.

Definition at line 922 of file station_cmd.cpp.

References StationSpec::bridgeable_info, GetBridgeHeight(), GetSouthernBridgeEnd(), GetStationBridgeableTileInfo(), IsBridgeAbove(), and IsStationBridgeAboveOk().

Referenced by CmdBuildRailStation(), and CmdBuildRailWaypoint().

## ◆ IsUniqueWaypointName()

static bool IsUniqueWaypointName | ( | const std::string & | name | ) |
| static

Check whether the name is unique amongst the waypoints.

Parameters

  name | The name to check.

Returns
  True iff the name is unique.

Definition at line 568 of file waypoint_cmd.cpp.

References SpecializedStation< Waypoint, true >::Iterate().

Referenced by CmdRenameWaypoint().

## ◆ IsValidTileForWaypoint()

static CommandCost IsValidTileForWaypoint | ( | TileIndex | tile,
|  | Axis | axis,
|  | StationID * | waypoint
| ) |  |
| static

Check whether the given tile is suitable for a waypoint.

Parameters

  tile | the tile to check for suitability
  axis | the axis of the waypoint
  waypoint | Waypoint the waypoint to check for is already joined to. If we find another waypoint it can join to it will throw an error.

Definition at line 152 of file waypoint_cmd.cpp.

References _settings_game, Auto, ConstructionSettings::build_on_slopes, CheckOwnership(), ClearTile_Station(), GameSettings::construction, EnsureNoVehicleOnGround(), CommandCost::Failed(), GetAxisForNewRailWaypoint(), GetStationIndex(), GetTileOwner(), GetTileSlope(), IsRailWaypoint(), IsSteepSlope(), IsTileType(), MP_STATION, SLOPE_FLAT, and CommandCost::Succeeded().

Referenced by CmdBuildRailWaypoint().

## ◆ RemoveBuoy()

CommandCost RemoveBuoy | ( | TileIndex | tile,
|  | DoCommandFlags | flags
| ) |  |

Remove a buoy.

Parameters

  tile | TileIndex been queried
  flags | operation to perform

Precondition
  IsBuoyTile(tile)

Returns
  cost or failure of operation

Definition at line 530 of file waypoint_cmd.cpp.

References _current_company, Bankrupt, BaseStation::delete_ctr, Dock, EnsureNoVehicleOnGround(), Execute, EXPENSES_CONSTRUCTION, BaseStation::facilities, CommandCost::Failed(), BaseStation::GetByTile(), GetTileOwner(), HasStationInUse(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, INVALID_STRING_ID, InvalidateWindowData(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID(), BaseStation::rect, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Waypoint::UpdateVirtCoord(), and WC_WAYPOINT_VIEW.

Referenced by ClearTile_Station().

## ◆ RemoveRoadWaypointStop()

CommandCost RemoveRoadWaypointStop | ( | TileIndex | tile,
|  | DoCommandFlags | flags,
|  | int | replacement_spec_index
| ) |  |
| extern

Remove a road waypoint.

Parameters

  tile | TileIndex been queried
  flags | operation to perform
  replacement_spec_index | replacement spec index to avoid deallocating, if < 0, tile is not being replaced

Returns
  cost or failure of operation

Definition at line 2342 of file station_cmd.cpp.

References _current_company, Bankrupt, BusStop, CheckOwnership(), DeleteNewGRFInspectWindow(), DeleteStationIfEmpty(), DirtyCompanyInfrastructureWindows(), EnsureNoVehicleOnGround(), Execute, EXPENSES_CONSTRUCTION, BaseStation::facilities, CommandCost::Failed(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), BaseStation::GetByTile(), RoadStopSpec::GetClearCost(), GetCustomRoadStopSpecIndex(), GetRoadOwner(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, INVALID_TILE, BaseStation::owner, OWNER_WATER, BaseStation::rect, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), ROAD_STOP_TRACKBIT_FACTOR, Waypoint::road_waypoint_area, SetWindowWidgetDirty(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), OrthogonalTileArea::tile, TruckStop, UpdateCompanyRoadInfrastructure(), Waypoint::UpdateVirtCoord(), WC_STATION_VIEW, and WID_SV_ROADVEHS.

Referenced by ClearTile_Station(), CmdBuildRoadWaypoint(), and RemoveGenericRoadStop().