Skip to content

Commit 3b0df97

Browse files
authoredNov 10, 2019
Randomwalk caves: Extend beyond mapchunk vertically also (#9094)
Previously, randomwalk caves only extended beyond the mapchunk borders horizontally, preventing vertical overlap and interconnection.
1 parent d961ece commit 3b0df97

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎src/mapgen/cavegen.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,13 @@ void CavesRandomWalk::makeCave(MMVManip *vm, v3s16 nmin, v3s16 nmax,
366366
// Area starting point in nodes
367367
of = node_min;
368368

369-
// Allow a bit more (this should be more than the maximum radius of the tunnel)
369+
// Allow caves to extend up to 16 nodes beyond the mapchunk edge, to allow
370+
// connecting with caves of neighbor mapchunks.
371+
// 'insure' is needed to avoid many 'out of voxelmanip' cave nodes.
370372
const s16 insure = 2;
371373
s16 more = MYMAX(MAP_BLOCKSIZE - max_tunnel_diameter / 2 - insure, 1);
372-
ar += v3s16(1, 0, 1) * more * 2;
373-
of -= v3s16(1, 0, 1) * more;
374+
ar += v3s16(1, 1, 1) * more * 2;
375+
of -= v3s16(1, 1, 1) * more;
374376

375377
route_y_min = 0;
376378
// Allow half a diameter + 7 over stone surface

0 commit comments

Comments
 (0)
Please sign in to comment.