Skip to content

Commit 86b19f2

Browse files
authoredJun 3, 2018
Biome dust placement: Improve comments, re-order some lines
1 parent 5316b8f commit 86b19f2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed
 

Diff for: ‎src/mapgen/mapgen.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,10 @@ void MapgenBasic::dustTopNodes()
791791
if (biome->c_dust == CONTENT_IGNORE)
792792
continue;
793793

794+
// Check if mapchunk above has generated, if so, drop dust from 16 nodes
795+
// above current mapchunk top, above decorations that will extend above
796+
// the current mapchunk. If the mapchunk above has not generated, it
797+
// will provide this required dust when it does.
794798
u32 vi = vm->m_area.index(x, full_node_max.Y, z);
795799
content_t c_full_max = vm->m_data[vi].getContent();
796800
s16 y_start;
@@ -819,14 +823,15 @@ void MapgenBasic::dustTopNodes()
819823

820824
content_t c = vm->m_data[vi].getContent();
821825
NodeDrawType dtype = ndef->get(c).drawtype;
822-
// Only place on walkable cubic non-liquid nodes
823-
// Dust check needed due to vertical overgeneration
826+
// Only place on cubic, walkable, non-dust nodes.
827+
// Dust check needed due to avoid double layer of dust caused by
828+
// dropping dust from 16 nodes above mapchunk top.
824829
if ((dtype == NDT_NORMAL ||
830+
dtype == NDT_ALLFACES ||
825831
dtype == NDT_ALLFACES_OPTIONAL ||
826-
dtype == NDT_GLASSLIKE_FRAMED_OPTIONAL ||
827832
dtype == NDT_GLASSLIKE ||
828833
dtype == NDT_GLASSLIKE_FRAMED ||
829-
dtype == NDT_ALLFACES) &&
834+
dtype == NDT_GLASSLIKE_FRAMED_OPTIONAL) &&
830835
ndef->get(c).walkable && c != biome->c_dust) {
831836
VoxelArea::add_y(em, vi, 1);
832837
vm->m_data[vi] = MapNode(biome->c_dust);

0 commit comments

Comments
 (0)
Please sign in to comment.