aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2016-05-30 13:15:14 +0100
committerparamat <mat.gregory@virginmedia.com>2016-06-02 07:31:01 +0100
commit569998011e0a9cb6179f1e79fb15b7a3ce80977f (patch)
tree61753e02a3962471c05861e2da213bb20d8f8b6c /src
parent14ef2b445adcec770defe1abf83af9d22ccf39d8 (diff)
downloadminetest-569998011e0a9cb6179f1e79fb15b7a3ce80977f.tar.gz
minetest-569998011e0a9cb6179f1e79fb15b7a3ce80977f.tar.bz2
minetest-569998011e0a9cb6179f1e79fb15b7a3ce80977f.zip
Mgv7: Always carve river channels in mountain terrain
Previously, rivers were sometimes blocked by vertical walls of mountain terrain due to river carving being disabled when base terrain height was below water_level - 16 Remove now unused base terrain heightmap created in generateTerrain()
Diffstat (limited to 'src')
-rw-r--r--src/mapgen_v7.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mapgen_v7.cpp b/src/mapgen_v7.cpp
index 9ff2fbe66..7327facae 100644
--- a/src/mapgen_v7.cpp
+++ b/src/mapgen_v7.cpp
@@ -206,13 +206,15 @@ void MapgenV7::makeChunk(BlockMakeData *data)
blockseed = getBlockSeed2(full_node_min, seed);
- // Generate terrain and ridges with initial heightmaps
+ // Generate base and mountain terrain
+ // An initial heightmap is no longer created here for use in generateRidgeTerrain()
s16 stone_surface_max_y = generateTerrain();
+ // Generate rivers
if (spflags & MGV7_RIDGES)
generateRidgeTerrain();
- // Update heightmap to include mountain terrain
+ // Create heightmap
updateHeightmap(node_min, node_max);
// Init biome generator, place biome-specific nodes, and build biomemap
@@ -331,7 +333,6 @@ int MapgenV7::generateTerrain()
for (s16 z = node_min.Z; z <= node_max.Z; z++)
for (s16 x = node_min.X; x <= node_max.X; x++, index2d++) {
s16 surface_y = baseTerrainLevelFromMap(index2d);
- heightmap[index2d] = surface_y; // Create base terrain heightmap
if (surface_y > stone_surface_max_y)
stone_surface_max_y = surface_y;
@@ -382,9 +383,6 @@ void MapgenV7::generateRidgeTerrain()
for (s16 x = node_min.X; x <= node_max.X; x++, index++, vi++) {
int j = (z - node_min.Z) * csize.X + (x - node_min.X);
- if (heightmap[j] < water_level - 16) // Use base terrain heightmap
- continue;
-
float uwatern = noise_ridge_uwater->result[j] * 2;
if (fabs(uwatern) > width)
continue;