aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-04-07 17:59:24 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-04-07 17:59:24 +0300
commit2e60593c5b6cd7cc6d809ea9d3629d2b12f991ac (patch)
treebaa3918ea24d4c82f2944b7d7e5a93b2517ff023 /src
parent531fe10f5116e1a82fae33d1826d4d6ad79a0c78 (diff)
downloadminetest-2e60593c5b6cd7cc6d809ea9d3629d2b12f991ac.tar.gz
minetest-2e60593c5b6cd7cc6d809ea9d3629d2b12f991ac.tar.bz2
minetest-2e60593c5b6cd7cc6d809ea9d3629d2b12f991ac.zip
Tune desert beaches
Diffstat (limited to 'src')
-rw-r--r--src/mapgen.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mapgen.cpp b/src/mapgen.cpp
index 1d1d663c0..d227ef835 100644
--- a/src/mapgen.cpp
+++ b/src/mapgen.cpp
@@ -1790,11 +1790,6 @@ void make_block(BlockMakeData *data)
// Node position in 2d
v2s16 p2d = v2s16(x,z);
- MapNode addnode(c_dirt);
- BiomeType bt = get_biome(data->seed, p2d);
- if(bt == BT_DESERT)
- addnode = MapNode(c_desert_sand);
-
// Randomize mud amount
s16 mud_add_amount = get_mud_add_amount(data->seed, p2d) / 2.0 + 0.5;
@@ -1804,7 +1799,15 @@ void make_block(BlockMakeData *data)
if(surface_y == vmanip.m_area.MinEdge.Y - 1)
continue;
- if(mud_add_amount <= 0){
+ MapNode addnode(c_dirt);
+ BiomeType bt = get_biome(data->seed, p2d);
+
+ if(bt == BT_DESERT)
+ addnode = MapNode(c_desert_sand);
+
+ if(bt == BT_DESERT && surface_y + mud_add_amount <= WATER_LEVEL+1){
+ addnode = MapNode(c_sand);
+ } else if(mud_add_amount <= 0){
mud_add_amount = 1 - mud_add_amount;
addnode = MapNode(c_gravel);
} else if(bt == BT_NORMAL && get_have_beach(data->seed, p2d) &&