From 392ac41c993daba284d4840fe93169f802d860b6 Mon Sep 17 00:00:00 2001 From: paramat Date: Mon, 6 Apr 2015 22:52:08 +0100 Subject: Cavegen: Remove now unnecessary checks for water, lava, ice Remove large cave checks for air Mgv5/mgv7:Add is_ground_content checks to 3d noise tunnels More large caves Shorten lines --- src/cavegen.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/cavegen.cpp') diff --git a/src/cavegen.cpp b/src/cavegen.cpp index 8fb1a7293..1786b252d 100644 --- a/src/cavegen.cpp +++ b/src/cavegen.cpp @@ -262,11 +262,8 @@ void CaveV5::carveRoute(v3f vec, float f, bool randomize_xz, bool is_ravine) { continue; u32 i = vm->m_area.index(p); - - // Don't replace air, water, lava, or ice content_t c = vm->m_data[i].getContent(); - if (!ndef->get(c).is_ground_content || c == CONTENT_AIR || - c == c_water_source || c == c_lava_source || c == c_ice) + if (!ndef->get(c).is_ground_content) continue; int full_ymin = node_min.Y - MAP_BLOCKSIZE; @@ -551,9 +548,7 @@ void CaveV6::carveRoute(v3f vec, float f, bool randomize_xz) { vm->m_data[i] = airnode; } } else { - // Don't replace air or water or lava or ignore - if (c == CONTENT_IGNORE || c == CONTENT_AIR || - c == c_water_source || c == c_lava_source) + if (c == CONTENT_IGNORE || c == CONTENT_AIR) continue; vm->m_data[i] = airnode; @@ -800,11 +795,8 @@ void CaveV7::carveRoute(v3f vec, float f, bool randomize_xz, bool is_ravine) { continue; u32 i = vm->m_area.index(p); - - // Don't replace air, water, lava, or ice content_t c = vm->m_data[i].getContent(); - if (!ndef->get(c).is_ground_content || c == CONTENT_AIR || - c == c_water_source || c == c_lava_source || c == c_ice) + if (!ndef->get(c).is_ground_content) continue; int full_ymin = node_min.Y - MAP_BLOCKSIZE; -- cgit v1.2.3