summaryrefslogtreecommitdiff
path: root/src/mapgen_v7.cpp
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2015-06-25 23:55:01 +0100
committerparamat <mat.gregory@virginmedia.com>2015-06-27 03:36:40 +0100
commit36163d96533313f8fd336c04911383569582acc1 (patch)
tree8d66942fade4fe550472b46f92eeb30c8f42fcc8 /src/mapgen_v7.cpp
parentffd16e3feca90c356c55898de2b9f3f5c6bc5c98 (diff)
downloadminetest-36163d96533313f8fd336c04911383569582acc1.tar.gz
minetest-36163d96533313f8fd336c04911383569582acc1.tar.bz2
minetest-36163d96533313f8fd336c04911383569582acc1.zip
Mgv5/mgv7 caves: Remove sand found in underground tunnels
Add missing check for max_stone_y to mgv5 cavegen Tunnels now carve through sand below water_level
Diffstat (limited to 'src/mapgen_v7.cpp')
-rw-r--r--src/mapgen_v7.cpp37
1 files changed, 13 insertions, 24 deletions
diff --git a/src/mapgen_v7.cpp b/src/mapgen_v7.cpp
index b5d1463db..7fe5a3848 100644
--- a/src/mapgen_v7.cpp
+++ b/src/mapgen_v7.cpp
@@ -852,32 +852,21 @@ void MapgenV7::generateCaves(int max_stone_y)
{
if (max_stone_y >= node_min.Y) {
u32 index = 0;
- u32 index2d = 0;
-
- for (s16 z = node_min.Z; z <= node_max.Z; z++) {
- for (s16 y = node_min.Y - 1; y <= node_max.Y + 1; y++) {
- u32 i = vm->m_area.index(node_min.X, y, z);
- for (s16 x = node_min.X; x <= node_max.X;
- x++, i++, index++, index2d++) {
- float d1 = contour(noise_cave1->result[index]);
- float d2 = contour(noise_cave2->result[index]);
- if (d1 * d2 > 0.3) {
- Biome *biome = (Biome *)bmgr->
- getRaw(biomemap[index2d]);
- content_t c = vm->m_data[i].getContent();
- if (!ndef->get(c).is_ground_content ||
- c == CONTENT_AIR ||
- (y <= water_level &&
- c != biome->c_stone &&
- c != c_stone))
- continue;
-
- vm->m_data[i] = MapNode(CONTENT_AIR);
- }
+
+ for (s16 z = node_min.Z; z <= node_max.Z; z++)
+ for (s16 y = node_min.Y - 1; y <= node_max.Y + 1; y++) {
+ u32 i = vm->m_area.index(node_min.X, y, z);
+ for (s16 x = node_min.X; x <= node_max.X; x++, i++, index++) {
+ float d1 = contour(noise_cave1->result[index]);
+ float d2 = contour(noise_cave2->result[index]);
+ if (d1 * d2 > 0.3) {
+ content_t c = vm->m_data[i].getContent();
+ if (!ndef->get(c).is_ground_content || c == CONTENT_AIR)
+ continue;
+
+ vm->m_data[i] = MapNode(CONTENT_AIR);
}
- index2d -= ystride;
}
- index2d += ystride;
}
}