|
OpenTTD Source 20260208-master-g43af8e94d0
|
Command definitions related to tree tiles. More...
#include "command_type.h"Go to the source code of this file.
Functions | |
| void | PlaceTree (TileIndex tile, uint32_t r, bool keep_density=false) |
| Make a random tree tile of the given tile. | |
| CommandCost | CmdPlantTree (DoCommandFlags flags, TileIndex tile, TileIndex start_tile, uint8_t tree_to_plant, bool diagonal) |
| Plant a tree. | |
Command definitions related to tree tiles.
Definition in file tree_cmd.h.
| CommandCost CmdPlantTree | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| TileIndex | start_tile, | ||
| uint8_t | tree_to_plant, | ||
| bool | diagonal ) |
Plant a tree.
| flags | type of operation |
| tile | end tile of area-drag |
| start_tile | start tile of area-drag of tree plantation |
| tree_to_plant | tree type, TREE_INVALID means random. |
| diagonal | Whether to use the Orthogonal (false) or Diagonal (true) iterator. |
Definition at line 514 of file tree_cmd.cpp.
References _current_company, _settings_game, CommandCost::AddCost(), AddTreeCount(), BuildTrees, ChangeTownRating(), Clear, ClosestTownFromTile(), CMD_ERROR, TileIterator::Create(), Execute, EXPENSES_OTHER, CommandCost::Failed(), Fields, GB(), GetClearGround(), CommandCost::GetCost(), GetRandomTreeType(), GetTileSlope(), GetTileType(), GetTreeCount(), GetTropicZone(), Growing1, Grown, INVALID_STRING_ID, INVALID_TILE, IsBridgeAbove(), IsCoast(), IsInsideBS(), IsInsideMM(), IsSlopeWithOneCornerRaised(), IsTileType(), MarkTileDirtyByTile(), PlantTreesOnTile(), Rocks, SetTropicZone(), Map::Size(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), to_underlying(), TREE_CACTUS, TREE_INVALID, CompanyProperties::tree_limit, TREE_RAINFOREST, TREE_SUB_TROPICAL, TREE_TOYLAND, Trees, Tropic, TROPICZONE_DESERT, TROPICZONE_NORMAL, TROPICZONE_RAINFOREST, and Water.
| void PlaceTree | ( | TileIndex | tile, |
| uint32_t | r, | ||
| bool | keep_density ) |
Make a random tree tile of the given tile.
Create a new tree-tile for the given tile. The second parameter is used for randomness like type and number of trees.
| tile | The tile to make a tree-tile from |
| r | The randomness value from a Random() value |
| keep_density | Whether to keep the existing ground density of the tile. |
Definition at line 171 of file tree_cmd.cpp.
References GB(), GetRandomTreeType(), GetTreeGround(), MarkTileDirtyByTile(), PlantTreesOnTile(), RoughSnow, SetTreeGroundDensity(), Shore, SnowOrDesert, and TREE_INVALID.
Referenced by MakeWetlands(), PlaceTreeAtSameHeight(), PlaceTreeGroups(), and PlaceTreesRandomly().