summaryrefslogtreecommitdiff
path: root/src/mapgen
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2019-11-10 01:41:20 +0000
committerGitHub <noreply@github.com>2019-11-10 01:41:20 +0000
commit3b0df9760b9630ddba1983ecb4c6e4f0f8857149 (patch)
tree46c1e03adcb05193ad659514f4e38eddaface6c2 /src/mapgen
parentd961ece144c239a61ff46d830041249867656e9c (diff)
downloadminetest-3b0df9760b9630ddba1983ecb4c6e4f0f8857149.tar.gz
minetest-3b0df9760b9630ddba1983ecb4c6e4f0f8857149.tar.bz2
minetest-3b0df9760b9630ddba1983ecb4c6e4f0f8857149.zip
Randomwalk caves: Extend beyond mapchunk vertically also (#9094)
Previously, randomwalk caves only extended beyond the mapchunk borders horizontally, preventing vertical overlap and interconnection.
Diffstat (limited to 'src/mapgen')
-rw-r--r--src/mapgen/cavegen.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mapgen/cavegen.cpp b/src/mapgen/cavegen.cpp
index 2e2a1bbe3..d3d51935b 100644
--- a/src/mapgen/cavegen.cpp
+++ b/src/mapgen/cavegen.cpp
@@ -366,11 +366,13 @@ void CavesRandomWalk::makeCave(MMVManip *vm, v3s16 nmin, v3s16 nmax,
// Area starting point in nodes
of = node_min;
- // Allow a bit more (this should be more than the maximum radius of the tunnel)
+ // Allow caves to extend up to 16 nodes beyond the mapchunk edge, to allow
+ // connecting with caves of neighbor mapchunks.
+ // 'insure' is needed to avoid many 'out of voxelmanip' cave nodes.
const s16 insure = 2;
s16 more = MYMAX(MAP_BLOCKSIZE - max_tunnel_diameter / 2 - insure, 1);
- ar += v3s16(1, 0, 1) * more * 2;
- of -= v3s16(1, 0, 1) * more;
+ ar += v3s16(1, 1, 1) * more * 2;
+ of -= v3s16(1, 1, 1) * more;
route_y_min = 0;
// Allow half a diameter + 7 over stone surface