aboutsummaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2011-06-01 04:57:46 +0200
committerNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2011-06-01 04:57:46 +0200
commitcffd40c5d6c1427d2cce7cbcfe57669da73459c6 (patch)
tree641ee4fdeb60818a08839e5555bcb0fe0daafd12 /src/map.cpp
parentfb78854e9b4f6ae648de27656ad40991a0c5ef57 (diff)
downloadminetest-cffd40c5d6c1427d2cce7cbcfe57669da73459c6.tar.gz
minetest-cffd40c5d6c1427d2cce7cbcfe57669da73459c6.tar.bz2
minetest-cffd40c5d6c1427d2cce7cbcfe57669da73459c6.zip
+ clay and associated items
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
{