File tree 3 files changed +15
-3
lines changed
3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -565,6 +565,7 @@ void MapgenFlat::generateCaves(s16 max_stone_y)
565
565
for (s16 z = node_min.Z ; z <= node_max.Z ; z++)
566
566
for (s16 x = node_min.X ; x <= node_max.X ; x++, index2d++) {
567
567
bool column_is_open = false ; // Is column open to overground
568
+ bool is_tunnel = false ; // Is tunnel or tunnel floor
568
569
u32 vi = vm->m_area .index (x, node_max.Y + 1 , z);
569
570
u32 index3d = (z - node_min.Z ) * zstride + (csize.Y + 1 ) * ystride +
570
571
(x - node_min.X );
@@ -591,13 +592,16 @@ void MapgenFlat::generateCaves(s16 max_stone_y)
591
592
if (d1 * d2 > 0 .3f && ndef->get (c).is_ground_content ) {
592
593
// In tunnel and ground content, excavate
593
594
vm->m_data [vi] = MapNode (CONTENT_AIR);
594
- } else if (column_is_open &&
595
+ is_tunnel = true ;
596
+ } else if (is_tunnel && column_is_open &&
595
597
(c == biome->c_filler || c == biome->c_stone )) {
596
598
// Tunnel entrance floor
597
599
vm->m_data [vi] = MapNode (biome->c_top );
598
600
column_is_open = false ;
601
+ is_tunnel = false ;
599
602
} else {
600
603
column_is_open = false ;
604
+ is_tunnel = false ;
601
605
}
602
606
}
603
607
}
Original file line number Diff line number Diff line change @@ -693,6 +693,7 @@ void MapgenFractal::generateCaves(s16 max_stone_y)
693
693
for (s16 z = node_min.Z ; z <= node_max.Z ; z++)
694
694
for (s16 x = node_min.X ; x <= node_max.X ; x++, index2d++) {
695
695
bool column_is_open = false ; // Is column open to overground
696
+ bool is_tunnel = false ; // Is tunnel or tunnel floor
696
697
u32 vi = vm->m_area .index (x, node_max.Y + 1 , z);
697
698
u32 index3d = (z - node_min.Z ) * zstride + (csize.Y + 1 ) * ystride +
698
699
(x - node_min.X );
@@ -719,13 +720,16 @@ void MapgenFractal::generateCaves(s16 max_stone_y)
719
720
if (d1 * d2 > 0 .3f && ndef->get (c).is_ground_content ) {
720
721
// In tunnel and ground content, excavate
721
722
vm->m_data [vi] = MapNode (CONTENT_AIR);
722
- } else if (column_is_open &&
723
+ is_tunnel = true ;
724
+ } else if (is_tunnel && column_is_open &&
723
725
(c == biome->c_filler || c == biome->c_stone )) {
724
726
// Tunnel entrance floor
725
727
vm->m_data [vi] = MapNode (biome->c_top );
726
728
column_is_open = false ;
729
+ is_tunnel = false ;
727
730
} else {
728
731
column_is_open = false ;
732
+ is_tunnel = false ;
729
733
}
730
734
}
731
735
}
Original file line number Diff line number Diff line change @@ -875,6 +875,7 @@ void MapgenV7::generateCaves(s16 max_stone_y)
875
875
for (s16 z = node_min.Z ; z <= node_max.Z ; z++)
876
876
for (s16 x = node_min.X ; x <= node_max.X ; x++, index2d++) {
877
877
bool column_is_open = false ; // Is column open to overground
878
+ bool is_tunnel = false ; // Is tunnel or tunnel floor
878
879
u32 vi = vm->m_area .index (x, node_max.Y + 1 , z);
879
880
u32 index3d = (z - node_min.Z ) * zstride + (csize.Y + 1 ) * ystride +
880
881
(x - node_min.X );
@@ -901,13 +902,16 @@ void MapgenV7::generateCaves(s16 max_stone_y)
901
902
if (d1 * d2 > 0 .3f && ndef->get (c).is_ground_content ) {
902
903
// In tunnel and ground content, excavate
903
904
vm->m_data [vi] = MapNode (CONTENT_AIR);
904
- } else if (column_is_open &&
905
+ is_tunnel = true ;
906
+ } else if (is_tunnel && column_is_open &&
905
907
(c == biome->c_filler || c == biome->c_stone )) {
906
908
// Tunnel entrance floor
907
909
vm->m_data [vi] = MapNode (biome->c_top );
908
910
column_is_open = false ;
911
+ is_tunnel = false ;
909
912
} else {
910
913
column_is_open = false ;
914
+ is_tunnel = false ;
911
915
}
912
916
}
913
917
}
You can’t perform that action at this time.
0 commit comments