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

Function MakeRiverAndModifyDesertZoneAround

src/water_cmd.cpp:472–481  ·  view source on GitHub ↗

* Make a river tile and remove desert directly around it. * @param tile The tile to change into river and create non-desert around */

Source from the content-addressed store, hash-verified

470 * @param tile The tile to change into river and create non-desert around
471 */
472void MakeRiverAndModifyDesertZoneAround(TileIndex tile)
473{
474 MakeRiver(tile, Random());
475 MarkTileDirtyByTile(tile);
476
477 /* Remove desert directly around the river tile. */
478 for (auto t : SpiralTileSequence(tile, RIVER_OFFSET_DESERT_DISTANCE)) {
479 if (GetTropicZone(t) == TROPICZONE_DESERT) SetTropicZone(t, TROPICZONE_NORMAL);
480 }
481}
482
483/**
484 * Build a piece of canal.

Callers 4

MakeLakeFunction · 0.85
MakeWetlandsFunction · 0.85
RiverMakeWiderFunction · 0.85
BuildRiverMethod · 0.85

Calls 6

MakeRiverFunction · 0.85
SpiralTileSequenceClass · 0.85
GetTropicZoneFunction · 0.85
SetTropicZoneFunction · 0.85
MarkTileDirtyByTileFunction · 0.70
RandomFunction · 0.50

Tested by

no test coverage detected