summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/map.cpp b/src/map.cpp
index c48599d47..bf9f38c87 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -3141,6 +3141,13 @@ void makeChunk(ChunkMakeData *data)
if(have_sand == false)
continue;
+ // Determine whether to have clay in the sand here
+ double claynoise = noise2d_perlin(
+ 0.5+(float)p2d.X/500, 0.5+(float)p2d.Y/500,
+ data->seed+4321, 8, 0.95);
+
+ bool have_clay = have_sand && (claynoise > 0.95);
+
// Find ground level
s16 surface_y = find_ground_level_clever(data->vmanip, p2d);
@@ -3157,7 +3164,10 @@ void makeChunk(ChunkMakeData *data)
MapNode *n = &data->vmanip.m_data[i];
if(n->d == CONTENT_MUD || n->d == CONTENT_GRASS)
{
- n->d = CONTENT_SAND;
+ if(have_clay && (surface_y == WATER_LEVEL))
+ n->d = CONTENT_CLAY;
+ else
+ n->d = CONTENT_SAND;
}
else
{