OpenTTD Source  20240919-master-gdf0233f4c2
tree_cmd.h File Reference
#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. More...
 

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 388 of file tree_cmd.cpp.

References CMD_ERROR, EXPENSES_OTHER, INVALID_STRING_ID, IsInsideBS(), Map::Size(), and TREE_INVALID.