aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen_v5.cpp
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2014-11-30 04:42:02 +0000
committerkwolekr <kwolekr@minetest.net>2014-12-03 19:45:29 -0500
commit0a5373d4002d462208d810dd8c3b5f5f8b3cf429 (patch)
treea8e258dd8e4d48683cb38846b263c9caa2b7722b /src/mapgen_v5.cpp
parentfcb1ea903faf8933142a04b7c8ab89ec08a0be24 (diff)
downloadminetest-0a5373d4002d462208d810dd8c3b5f5f8b3cf429.tar.gz
minetest-0a5373d4002d462208d810dd8c3b5f5f8b3cf429.tar.bz2
minetest-0a5373d4002d462208d810dd8c3b5f5f8b3cf429.zip
Add definable node_stone to biome API, mgv5, mgv7. Reduce and correct depth of mgv7 biomes. l_mapgen.cpp: add '#include mapgen_v5.h' because '#include mapgen_v7' is there. Improve underwater grass hack
Diffstat (limited to 'src/mapgen_v5.cpp')
-rw-r--r--src/mapgen_v5.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mapgen_v5.cpp b/src/mapgen_v5.cpp
index ebc5e5719..3867827cc 100644
--- a/src/mapgen_v5.cpp
+++ b/src/mapgen_v5.cpp
@@ -451,23 +451,31 @@ void MapgenV5::generateBiomes() {
if (c_below != CONTENT_AIR) {
if (nplaced < y0_top) {
- // A hack to prevent dirt_with_grass from being
- // placed below water. TODO: fix later
- content_t c_place = ((y < water_level) &&
- (biome->c_top ==
- c_dirt_with_grass)) ?
- c_dirt : biome->c_top;
-
- vm->m_data[i] = MapNode(c_place);
+ if(y < water_level)
+ vm->m_data[i] = MapNode(biome->c_filler);
+ else
+ vm->m_data[i] = MapNode(biome->c_top);
nplaced++;
} else if (nplaced < y0_filler && nplaced >= y0_top) {
vm->m_data[i] = MapNode(biome->c_filler);
nplaced++;
+ } else if (c == c_stone) {
+ have_air = false;
+ nplaced = 0;
+ vm->m_data[i] = MapNode(biome->c_stone);
} else {
have_air = false;
nplaced = 0;
}
+ } else if (c == c_stone) {
+ have_air = false;
+ nplaced = 0;
+ vm->m_data[i] = MapNode(biome->c_stone);
}
+ } else if (c == c_stone) {
+ have_air = false;
+ nplaced = 0;
+ vm->m_data[i] = MapNode(biome->c_stone);
} else if (c == c_water_source) {
have_air = true;
nplaced = 0;