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

Function FlatEmptyWorld

src/heightmap.cpp:542–553  ·  view source on GitHub ↗

* Make an empty world where all tiles are of height 'tile_height'. * @param tile_height of the desired new empty world */

Source from the content-addressed store, hash-verified

540 * @param tile_height of the desired new empty world
541 */
542void FlatEmptyWorld(uint8_t tile_height)
543{
544 int edge_distance = _settings_game.construction.freeform_edges ? 0 : 2;
545 for (uint row = edge_distance; row < Map::SizeY() - edge_distance; row++) {
546 for (uint col = edge_distance; col < Map::SizeX() - edge_distance; col++) {
547 SetTileHeight(TileXY(col, row), tile_height);
548 }
549 }
550
551 FixSlopes();
552 MarkWholeScreenDirty();
553}

Callers 1

_GenerateWorldFunction · 0.85

Calls 4

SetTileHeightFunction · 0.85
TileXYFunction · 0.85
FixSlopesFunction · 0.85
MarkWholeScreenDirtyFunction · 0.85

Tested by

no test coverage detected