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

Function LevelTownLand

src/town_cmd.cpp:1131–1144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1129}
1130
1131static void LevelTownLand(TileIndex tile)
1132{
1133 assert(tile < Map::Size());
1134
1135 /* Don't terraform if land is plain or if there's a house there. */
1136 if (IsTileType(tile, MP_HOUSE)) return;
1137 Slope tileh = GetTileSlope(tile);
1138 if (tileh == SLOPE_FLAT) return;
1139
1140 /* First try up, then down */
1141 if (!TerraformTownTile(tile, ~tileh & SLOPE_ELEVATED, true)) {
1142 TerraformTownTile(tile, tileh & SLOPE_ELEVATED, false);
1143 }
1144}
1145
1146/**
1147 * Generate the RoadBits of a grid tile.

Callers 1

GrowTownInTileFunction · 0.85

Calls 3

IsTileTypeFunction · 0.85
GetTileSlopeFunction · 0.85
TerraformTownTileFunction · 0.85

Tested by

no test coverage detected