From 747bc40840ff13bcf9c7a60b790a6de24f94f946 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Fri, 29 Nov 2013 20:54:04 -0500 Subject: Cavegen: Respect is_ground_content MapNode setting; fix some code formatting issues --- src/cavegen.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/cavegen.cpp') diff --git a/src/cavegen.cpp b/src/cavegen.cpp index 51af50984..71f005d5b 100644 --- a/src/cavegen.cpp +++ b/src/cavegen.cpp @@ -236,6 +236,9 @@ void CaveV6::carveRoute(v3f vec, float f, bool randomize_xz) { continue; u32 i = vm->m_area.index(p); + content_t c = vm->m_data[i].getContent(); + if (!ndef->get(c).is_ground_content) + continue; if (large_cave) { int full_ymin = node_min.Y - MAP_BLOCKSIZE; @@ -250,7 +253,6 @@ void CaveV6::carveRoute(v3f vec, float f, bool randomize_xz) { } } else { // Don't replace air or water or lava or ignore - content_t c = vm->m_data[i].getContent(); if (c == CONTENT_IGNORE || c == CONTENT_AIR || c == c_water_source || c == c_lava_source) continue; @@ -530,8 +532,8 @@ void CaveV7::carveRoute(v3f vec, float f, bool randomize_xz, bool is_ravine) { // Don't replace air, water, lava, or ice content_t c = vm->m_data[i].getContent(); - if (c == CONTENT_AIR || c == c_water_source || - c == c_lava_source || c == c_ice) + if (!ndef->get(c).is_ground_content || c == CONTENT_AIR || + c == c_water_source || c == c_lava_source || c == c_ice) continue; if (large_cave) { -- cgit v1.2.3