OpenTTD Source  20240919-master-gdf0233f4c2
landscape_cmd.h File Reference
#include "command_type.h"

Go to the source code of this file.

Functions

CommandCost CmdLandscapeClear (DoCommandFlag flags, TileIndex tile)
 Clear a piece of landscape. More...
 
std::tuple< CommandCost, MoneyCmdClearArea (DoCommandFlag flags, TileIndex tile, TileIndex start_tile, bool diagonal)
 Clear a big piece of landscape. More...
 

Detailed Description

Command definitions related to landscape (slopes etc.).

Definition in file landscape_cmd.h.

Function Documentation

◆ CmdClearArea()

std::tuple<CommandCost, Money> CmdClearArea ( DoCommandFlag  flags,
TileIndex  tile,
TileIndex  start_tile,
bool  diagonal 
)

Clear a big piece of landscape.

Parameters
flagsof operation to conduct
tileend tile of area dragging
start_tilestart tile of area dragging
diagonalWhether to use the Orthogonal (false) or Diagonal (true) iterator.
Returns
the cost of this operation or an error

Definition at line 709 of file landscape.cpp.

References _current_company, _pause_mode, CommandCost::AddCost(), CompanyProperties::clear_limit, CMD_ERROR, TileIterator::Create(), CreateEffectVehicleAbove(), DC_AUTO, DC_BANKRUPT, DC_EXEC, DC_FORCE_CLEAR_TILE, EV_EXPLOSION_LARGE, EV_EXPLOSION_SMALL, EXPENSES_CONSTRUCTION, CommandCost::Failed(), GB(), GetAvailableMoneyForCommand(), CommandCost::GetCost(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), INVALID_TILE, PM_UNPAUSED, Map::Size(), TILE_SIZE, TileX(), and TileY().

◆ CmdLandscapeClear()

CommandCost CmdLandscapeClear ( DoCommandFlag  flags,
TileIndex  tile 
)

Clear a piece of landscape.

Parameters
flagsof operation to conduct
tiletile to clear
Returns
the cost of this operation or an error

Definition at line 652 of file landscape.cpp.

References CommandCost::AddCost(), DC_AUTO, DC_FORCE_CLEAR_TILE, EXPENSES_CONSTRUCTION, GetWaterClass(), HasTileWaterClass(), IsCoastTile(), IsTileOnWater(), IsWaterTile(), return_cmd_error, and WATER_CLASS_CANAL.