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

Function UpdateFreeformEdges

src/settings_table.cpp:501–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499}
500
501static void UpdateFreeformEdges(int32_t new_value)
502{
503 if (_game_mode == GM_MENU) return;
504
505 if (new_value != 0) {
506 for (uint x = 0; x < Map::SizeX(); x++) MakeVoid(TileXY(x, 0));
507 for (uint y = 0; y < Map::SizeY(); y++) MakeVoid(TileXY(0, y));
508 } else {
509 /* Make tiles at the border water again. */
510 for (uint i = 0; i < Map::MaxX(); i++) {
511 SetTileHeight(TileXY(i, 0), 0);
512 SetTileType(TileXY(i, 0), MP_WATER);
513 }
514 for (uint i = 0; i < Map::MaxY(); i++) {
515 SetTileHeight(TileXY(0, i), 0);
516 SetTileType(TileXY(0, i), MP_WATER);
517 }
518 }
519 MarkWholeScreenDirty();
520}
521
522/**
523 * Changing the setting "allow multiple NewGRF sets" is not allowed

Callers

nothing calls this directly

Calls 5

MakeVoidFunction · 0.85
TileXYFunction · 0.85
SetTileHeightFunction · 0.85
SetTileTypeFunction · 0.85
MarkWholeScreenDirtyFunction · 0.85

Tested by

no test coverage detected