]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/mapgen_v7.cpp
Fix two reconnect bugs
[dragonfireclient.git] / src / mapgen_v7.cpp
index 029f56a45a74d3d9b8f38dcbaa7024ab552d065e..24867623cec11b551ce329d9f8016e89ded8a473 100644 (file)
@@ -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) {