aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2018-05-31 03:06:55 +0100
committerGitHub <noreply@github.com>2018-05-31 03:06:55 +0100
commitdf991edaa8617730f4ad15648e9131325a0fe2e8 (patch)
treea14c23858953b7cc6847223a925cf03ff6e4e8ad /src/mapgen
parentddd03c38a418c9f2ed204bf4fa68fd1d5feac11f (diff)
downloadminetest-df991edaa8617730f4ad15648e9131325a0fe2e8.tar.gz
minetest-df991edaa8617730f4ad15648e9131325a0fe2e8.tar.bz2
minetest-df991edaa8617730f4ad15648e9131325a0fe2e8.zip
Mgv7: Avoid rivergen removing mod-placed nodes when overgenerating (#7388)
Only allow river generation to replace c_stone. This also acts as an optimisation by being placed before canyon shape calculation.
Diffstat (limited to 'src/mapgen')
-rw-r--r--src/mapgen/mapgen_v7.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mapgen/mapgen_v7.cpp b/src/mapgen/mapgen_v7.cpp
index 57646bd79..610de4623 100644
--- a/src/mapgen/mapgen_v7.cpp
+++ b/src/mapgen/mapgen_v7.cpp
@@ -591,6 +591,11 @@ void MapgenV7::generateRidgeTerrain()
float uwatern = noise_ridge_uwater->result[index2d] * 2.0f;
if (std::fabs(uwatern) > width)
continue;
+ // Optimises, but also avoids removing nodes placed by mods in
+ // 'on-generated', when generating outside mapchunk.
+ content_t c = vm->m_data[vi].getContent();
+ if (c != c_stone)
+ continue;
float altitude = y - water_level;
float height_mod = (altitude + 17.0f) / 2.5f;