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

Function AddTreeCount

src/tree_map.h:180–184  ·  view source on GitHub ↗

* Add a amount to the tree-count value of a tile with trees. * * This function add a value to the tree-count value of a tile. This * value may be negative to reduce the tree-counter. If the resulting * value reach 0 it doesn't get converted to a "normal" tile. * * @param t The tile to change the tree amount * @param c The value to add (or reduce) on the tree-count value * @pre Tile must be

Source from the content-addressed store, hash-verified

178 * @pre Tile must be of type MP_TREES
179 */
180inline void AddTreeCount(Tile t, int c)
181{
182 assert(IsTileType(t, MP_TREES)); // XXX incomplete
183 t.m5() += c << 6;
184}
185
186/**
187 * Returns the tree growth stage.

Callers 3

PlaceTreeGroupAroundTileFunction · 0.85
CmdPlantTreeFunction · 0.85
TileLoop_TreesFunction · 0.85

Calls 1

IsTileTypeFunction · 0.85

Tested by

no test coverage detected