From bb2ee54d3b841ebdb6c6a0b6573b64216ae0baae Mon Sep 17 00:00:00 2001 From: paramat Date: Sun, 13 Mar 2016 07:56:27 +0000 Subject: Mapgen: Fix light in tunnels at mapchunk borders Don't excavate the overgenerated stone at node_max.Y + 1, this creates a 'roof' over the tunnel, preventing light in tunnels at mapchunk borders when generating mapchunks upwards. --- src/mapgen_v7.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mapgen_v7.cpp') diff --git a/src/mapgen_v7.cpp b/src/mapgen_v7.cpp index 029f56a45..24867623c 100644 --- a/src/mapgen_v7.cpp +++ b/src/mapgen_v7.cpp @@ -883,6 +883,12 @@ void MapgenV7::generateCaves(s16 max_stone_y) for (s16 y = node_max.Y + 1; y >= node_min.Y - 1; y--, index3d -= ystride, vm->m_area.add_y(em, vi, -1)) { + // Don't excavate the overgenerated stone at node_max.Y + 1, + // this creates a 'roof' over the tunnel, preventing light in + // tunnels at mapchunk borders when generating mapchunks upwards. + if (y > node_max.Y) + continue; + content_t c = vm->m_data[vi].getContent(); if (c == CONTENT_AIR || c == biome->c_water_top || c == biome->c_water) { -- cgit v1.2.3