OpenTTD Source 20250205-master-gfd85ab1e2c
tree_cmd.h File Reference

Command definitions related to tree tiles. More...

#include "command_type.h"

Go to the source code of this file.

Functions

CommandCost CmdPlantTree (DoCommandFlag flags, TileIndex tile, TileIndex start_tile, uint8_t tree_to_plant, bool diagonal)
 Plant a tree.
 

Detailed Description

Command definitions related to tree tiles.

Definition in file tree_cmd.h.

Function Documentation

◆ CmdPlantTree()

CommandCost CmdPlantTree ( DoCommandFlag  flags,
TileIndex  tile,
TileIndex  start_tile,
uint8_t  tree_to_plant,
bool  diagonal 
)

Plant a tree.

Parameters
flagstype of operation
tileend tile of area-drag
start_tilestart tile of area-drag of tree plantation
tree_to_planttree type, TREE_INVALID means random.
diagonalWhether to use the Orthogonal (false) or Diagonal (true) iterator.
Returns
the cost of this operation or an error

Definition at line 392 of file tree_cmd.cpp.

References _current_company, _settings_game, CommandCost::AddCost(), AddTreeCount(), ChangeTownRating(), CLEAR_FIELDS, CLEAR_ROCKS, ClosestTownFromTile(), CMD_ERROR, TileIterator::Create(), DC_EXEC, EconomySettings::dist_local_authority, GameSettings::economy, EXPENSES_OTHER, CommandCost::Failed(), GameSettings::game_creation, GB(), CommandCost::GetCost(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), GetRandomTreeType(), GetRawClearGround(), GetTileSlope(), GetTileType(), GetTreeCount(), GetTropicZone(), Growing1, Grown, INVALID_STRING_ID, INVALID_TILE, IsBridgeAbove(), IsCoast(), IsInsideBS(), IsInsideMM(), IsSlopeWithOneCornerRaised(), IsTileType(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), GameCreationSettings::landscape, MarkTileDirtyByTile(), MP_CLEAR, MP_TREES, MP_WATER, PlantTreesOnTile(), Random, SetTropicZone(), Map::Size(), to_underlying(), TREE_CACTUS, TREE_INVALID, CompanyProperties::tree_limit, TREE_RAINFOREST, TREE_SUB_TROPICAL, TREE_TOYLAND, TROPICZONE_DESERT, TROPICZONE_NORMAL, and TROPICZONE_RAINFOREST.