MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetTreeCount

Function GetTreeCount

src/tree_map.h:163–167  ·  view source on GitHub ↗

* Returns the number of trees on a tile. * * This function returns the number of trees of a tile (1-4). * The tile must be contains at least one tree or be more specific: it must be * of type MP_TREES. * * @param t The index to get the number of trees * @return The number of trees (1-4) * @pre Tile must be of type MP_TREES */

Source from the content-addressed store, hash-verified

161 * @pre Tile must be of type MP_TREES
162 */
163inline uint GetTreeCount(Tile t)
164{
165 assert(IsTileType(t, MP_TREES));
166 return GB(t.m5(), 6, 2) + 1;
167}
168
169/**
170 * Add a amount to the tree-count value of a tile with trees.

Callers 5

PlaceTreeGroupAroundTileFunction · 0.85
CmdPlantTreeFunction · 0.85
DrawTile_TreesFunction · 0.85
ClearTile_TreesFunction · 0.85
TileLoop_TreesFunction · 0.85

Calls 2

IsTileTypeFunction · 0.85
GBFunction · 0.85

Tested by

no test coverage detected