* Make a lake centred on the given tile, of a random diameter. * @param lake_centre The middle tile of the lake. * @param height_lake The height of the lake. */
| 1069 | * @param height_lake The height of the lake. |
| 1070 | */ |
| 1071 | static void MakeLake(TileIndex lake_centre, uint height_lake) |
| 1072 | { |
| 1073 | MakeRiverAndModifyDesertZoneAround(lake_centre); |
| 1074 | uint diameter = RandomRange(8) + 3; |
| 1075 | |
| 1076 | /* Run the loop twice, so artefacts from going circular in one direction get (mostly) hidden. */ |
| 1077 | for (uint loops = 0; loops < 2; ++loops) { |
| 1078 | for (TileIndex tile : SpiralTileSequence(lake_centre, diameter)) { |
| 1079 | if (!IsValidRiverTerminusTile(tile, height_lake)) continue; |
| 1080 | for (DiagDirection d = DIAGDIR_BEGIN; d < DIAGDIR_END; d++) { |
| 1081 | TileIndex t = tile + TileOffsByDiagDir(d); |
| 1082 | if (IsWaterTile(t)) { |
| 1083 | MakeRiverAndModifyDesertZoneAround(tile); |
| 1084 | break; |
| 1085 | } |
| 1086 | } |
| 1087 | } |
| 1088 | } |
| 1089 | } |
| 1090 | |
| 1091 | /** |
| 1092 | * Make wetlands around the given tile. |
no test coverage detected