aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuane Robertson <duane@duanerobertson.com>2016-02-01 02:09:43 -0600
committerparamat <mat.gregory@virginmedia.com>2016-02-02 06:37:22 +0000
commit99c905c5633ebb5aef0ed8af13553c38b892c5e2 (patch)
tree62fefbe6dce9b6109f775227daa9e7fad8eba274
parent0a8af8814787654dcbe0459a28255586fbfa3bd1 (diff)
downloadminetest-99c905c5633ebb5aef0ed8af13553c38b892c5e2.tar.gz
minetest-99c905c5633ebb5aef0ed8af13553c38b892c5e2.tar.bz2
minetest-99c905c5633ebb5aef0ed8af13553c38b892c5e2.zip
Mgvalleys: fix riverbeds below sea level
Stop riverbeds from forming plateaus under sea. Minor corrections to random lava/water placement.
-rw-r--r--src/mapgen_valleys.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mapgen_valleys.cpp b/src/mapgen_valleys.cpp
index f003ae63c..ceb2c774d 100644
--- a/src/mapgen_valleys.cpp
+++ b/src/mapgen_valleys.cpp
@@ -99,8 +99,8 @@ MapgenValleys::MapgenValleys(int mapgenid, MapgenParams *params, EmergeManager *
this->water_features_lim = rangelim(sp->water_features, 0, 10);
// a small chance of overflows if the settings are very high
- this->cave_water_max_height = water_level + MYMAX(0, water_features_lim - 6) * 50;
- this->lava_max_height = water_level + MYMAX(0, lava_features_lim - 6) * 50;
+ this->cave_water_max_height = water_level + MYMAX(0, water_features_lim - 4) * 50;
+ this->lava_max_height = water_level + MYMAX(0, lava_features_lim - 4) * 50;
tcave_cache = new float[csize.Y + 2];
@@ -482,7 +482,8 @@ float MapgenValleys::terrainLevelFromNoise(TerrainNoise *tn)
// base - depth : height of the bottom of the river
// water_level - 6 : don't make rivers below 6 nodes under the surface
- mount = rangelim(base - depth, (float) (water_level - 6), mount);
+ // There is no logical equivalent to this using rangelim.
+ mount = MYMIN(MYMAX(base - depth, (float) (water_level - 6)), mount);
// Slope has no influence on rivers.
*tn->slope = 0.f;
@@ -846,8 +847,8 @@ void MapgenValleys::generateCaves(s16 max_stone_y)
// Reduce the odds of overflows even further.
if (node_max.Y > water_level) {
- lava_chance /= 5;
- water_chance /= 5;
+ lava_chance /= 3;
+ water_chance /= 3;
}
u32 index_2d = 0;