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

Function TerraformAddDirtyTileAround

src/terraform_cmd.cpp:82–89  ·  view source on GitHub ↗

* Adds all tiles that incident with the north corner of a specific tile to the "tile_table" in a TerraformerState. * * @param ts TerraformerState. * @param tile Tile. * @ingroup dirty */

Source from the content-addressed store, hash-verified

80 * @ingroup dirty
81 */
82static void TerraformAddDirtyTileAround(TerraformerState *ts, TileIndex tile)
83{
84 /* Make sure all tiles passed to TerraformAddDirtyTile are within [0, Map::Size()] */
85 if (TileY(tile) >= 1) TerraformAddDirtyTile(ts, tile + TileDiffXY( 0, -1));
86 if (TileY(tile) >= 1 && TileX(tile) >= 1) TerraformAddDirtyTile(ts, tile + TileDiffXY(-1, -1));
87 if (TileX(tile) >= 1) TerraformAddDirtyTile(ts, tile + TileDiffXY(-1, 0));
88 TerraformAddDirtyTile(ts, tile);
89}
90
91/**
92 * Terraform the north corner of a tile to a specific height.

Callers 1

TerraformTileHeightFunction · 0.85

Calls 4

TileYFunction · 0.85
TerraformAddDirtyTileFunction · 0.85
TileDiffXYFunction · 0.85
TileXFunction · 0.85

Tested by

no test coverage detected