diff options
author | paramat <mat.gregory@virginmedia.com> | 2016-03-13 07:56:27 +0000 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2016-03-14 08:45:01 +0000 |
commit | bb2ee54d3b841ebdb6c6a0b6573b64216ae0baae (patch) | |
tree | 89e43502d2e9c1791a53e6f280a71f9ec0790fed /src/mapgen_flat.cpp | |
parent | c0b6986e3875e6f42682c78fd5db0080a7bae651 (diff) | |
download | minetest-bb2ee54d3b841ebdb6c6a0b6573b64216ae0baae.tar.gz minetest-bb2ee54d3b841ebdb6c6a0b6573b64216ae0baae.tar.bz2 minetest-bb2ee54d3b841ebdb6c6a0b6573b64216ae0baae.zip |
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.
Diffstat (limited to 'src/mapgen_flat.cpp')
-rw-r--r-- | src/mapgen_flat.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mapgen_flat.cpp b/src/mapgen_flat.cpp index 0d071411d..d654a772e 100644 --- a/src/mapgen_flat.cpp +++ b/src/mapgen_flat.cpp @@ -573,6 +573,12 @@ void MapgenFlat::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) { |