diff options
Diffstat (limited to 'src/mapgen/mapgen.cpp')
-rw-r--r-- | src/mapgen/mapgen.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/mapgen/mapgen.cpp b/src/mapgen/mapgen.cpp index 6d5e721ce..a1ac7a5ca 100644 --- a/src/mapgen/mapgen.cpp +++ b/src/mapgen/mapgen.cpp @@ -843,18 +843,29 @@ void MapgenBasic::generateCavesNoiseIntersection(s16 max_stone_y) void MapgenBasic::generateCavesRandomWalk(s16 max_stone_y, s16 large_cave_depth) { - if (node_min.Y > max_stone_y || node_max.Y > large_cave_depth) + if (node_min.Y > max_stone_y) return; PseudoRandom ps(blockseed + 21343); - u32 bruises_count = ps.range(0, 2); + // Small randomwalk caves + u32 num_small_caves = ps.range(small_cave_num_min, small_cave_num_max); - for (u32 i = 0; i < bruises_count; i++) { + for (u32 i = 0; i < num_small_caves; i++) { CavesRandomWalk cave(ndef, &gennotify, seed, water_level, - c_water_source, c_lava_source, lava_depth, biomegen); + c_water_source, c_lava_source, large_cave_flooded, lava_depth, biomegen); + cave.makeCave(vm, node_min, node_max, &ps, false, max_stone_y, heightmap); + } + + if (node_max.Y > large_cave_depth) + return; + + // Large randomwalk caves below 'large_cave_depth' + u32 num_large_caves = ps.range(large_cave_num_min, large_cave_num_max); - cave.makeCave(vm, node_min, node_max, &ps, true, max_stone_y, - heightmap); + for (u32 i = 0; i < num_large_caves; i++) { + CavesRandomWalk cave(ndef, &gennotify, seed, water_level, + c_water_source, c_lava_source, large_cave_flooded, lava_depth, biomegen); + cave.makeCave(vm, node_min, node_max, &ps, true, max_stone_y, heightmap); } } |