Skip to content

Commit b952d42

Browse files
gaelysamparamat
authored andcommittedMar 3, 2018
MapgenValleys: Fixed submarine valleys shape
1 parent ebbd158 commit b952d42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/mapgen/mapgen_valleys.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
4040
#include "mg_decoration.h"
4141
#include "mapgen_valleys.h"
4242
#include "cavegen.h"
43+
#include <cmath>
4344

4445

4546
//#undef NDEBUG
@@ -373,7 +374,7 @@ float MapgenValleys::terrainLevelFromNoise(TerrainNoise *tn)
373374
// (here x = "river" and a = valley_profile).
374375
// "valley" represents the height of the terrain, from the rivers.
375376
{
376-
float t = river / tn->valley_profile;
377+
float t = std::fmax(river / tn->valley_profile, 0.0f);
377378
*tn->valley = valley_d * (1.f - exp(- MYSQUARE(t)));
378379
}
379380

0 commit comments

Comments
 (0)
Please sign in to comment.