projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ebbd158
)
MapgenValleys: Fixed submarine valleys shape
author
Gael-de-Sailly
<gael.chretien@akeonet.com>
Wed, 28 Feb 2018 17:51:53 +0000
(18:51 +0100)
committer
paramat
<mat.gregory@virginmedia.com>
Sat, 3 Mar 2018 22:59:26 +0000
(22:59 +0000)
src/mapgen/mapgen_valleys.cpp
patch
|
blob
|
history
diff --git
a/src/mapgen/mapgen_valleys.cpp
b/src/mapgen/mapgen_valleys.cpp
index 1705dce1ce3145e6b48803a1705eaac0e58652a0..0c606f3e870e5bd9c2e50a78ef49006d8c2a6d2f 100644
(file)
--- a/
src/mapgen/mapgen_valleys.cpp
+++ b/
src/mapgen/mapgen_valleys.cpp
@@
-40,6
+40,7
@@
with this program; if not, write to the Free Software Foundation, Inc.,
#include "mg_decoration.h"
#include "mapgen_valleys.h"
#include "cavegen.h"
+#include <cmath>
//#undef NDEBUG
@@
-373,7
+374,7
@@
float MapgenValleys::terrainLevelFromNoise(TerrainNoise *tn)
// (here x = "river" and a = valley_profile).
// "valley" represents the height of the terrain, from the rivers.
{
- float t =
river / tn->valley_profile
;
+ float t =
std::fmax(river / tn->valley_profile, 0.0f)
;
*tn->valley = valley_d * (1.f - exp(- MYSQUARE(t)));
}