aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2015-01-19 11:03:54 +0000
committerkwolekr <kwolekr@minetest.net>2015-01-22 02:21:11 -0500
commit1702c34b6406025802a4fbecd893c27827b3ce96 (patch)
tree310167444921cc7ad81994e9726ed5ab6e89954b /src
parent70354ac20b456f2cad3208e13ccb0a30980df39c (diff)
downloadminetest-1702c34b6406025802a4fbecd893c27827b3ce96.tar.gz
minetest-1702c34b6406025802a4fbecd893c27827b3ce96.tar.bz2
minetest-1702c34b6406025802a4fbecd893c27827b3ce96.zip
Mgv7 generateRidgeTerrain: Make river generation relative to water level
Remove widthn and make nridge zero underwater
Diffstat (limited to 'src')
-rw-r--r--src/mapgen_v7.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mapgen_v7.cpp b/src/mapgen_v7.cpp
index f13eee829..e8ca7809d 100644
--- a/src/mapgen_v7.cpp
+++ b/src/mapgen_v7.cpp
@@ -521,15 +521,10 @@ void MapgenV7::generateRidgeTerrain()
if (fabs(uwatern) > width)
continue;
- float widthn = (noise_terrain_persist->result[j] - 0.6) / 0.1;
- widthn = rangelim(widthn, -0.05, 0.5);
-
- float height_mod = (float)(y + 17) / 2.5;
- float width_mod = (width - fabs(uwatern));
- float nridge = noise_ridge->result[index] * (float)y / 7.0;
-
- if (y < water_level)
- nridge = -fabs(nridge) * 3.0 * widthn * 0.3;
+ float altitude = y - water_level;
+ float height_mod = (altitude + 17) / 2.5;
+ float width_mod = width - fabs(uwatern);
+ float nridge = noise_ridge->result[index] * MYMAX(altitude, 0) / 7.0;
if (nridge + width_mod * height_mod < 0.6)
continue;