summaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen.cpp
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2018-06-04 00:39:10 +0100
committerGitHub <noreply@github.com>2018-06-04 00:39:10 +0100
commit86b19f284990304f5c8322040f277138333a3697 (patch)
tree47d8b3b3a7a9f2a6f164b39c57f88208a2da5276 /src/mapgen/mapgen.cpp
parent5316b8fe4a5858f0307a58c0ab5630286fd573be (diff)
downloadminetest-86b19f284990304f5c8322040f277138333a3697.tar.gz
minetest-86b19f284990304f5c8322040f277138333a3697.tar.bz2
minetest-86b19f284990304f5c8322040f277138333a3697.zip
Biome dust placement: Improve comments, re-order some lines
Diffstat (limited to 'src/mapgen/mapgen.cpp')
-rw-r--r--src/mapgen/mapgen.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mapgen/mapgen.cpp b/src/mapgen/mapgen.cpp
index 6163d17af..dcdaf82c2 100644
--- a/src/mapgen/mapgen.cpp
+++ b/src/mapgen/mapgen.cpp
@@ -791,6 +791,10 @@ void MapgenBasic::dustTopNodes()
if (biome->c_dust == CONTENT_IGNORE)
continue;
+ // Check if mapchunk above has generated, if so, drop dust from 16 nodes
+ // above current mapchunk top, above decorations that will extend above
+ // the current mapchunk. If the mapchunk above has not generated, it
+ // will provide this required dust when it does.
u32 vi = vm->m_area.index(x, full_node_max.Y, z);
content_t c_full_max = vm->m_data[vi].getContent();
s16 y_start;
@@ -819,14 +823,15 @@ void MapgenBasic::dustTopNodes()
content_t c = vm->m_data[vi].getContent();
NodeDrawType dtype = ndef->get(c).drawtype;
- // Only place on walkable cubic non-liquid nodes
- // Dust check needed due to vertical overgeneration
+ // Only place on cubic, walkable, non-dust nodes.
+ // Dust check needed due to avoid double layer of dust caused by
+ // dropping dust from 16 nodes above mapchunk top.
if ((dtype == NDT_NORMAL ||
+ dtype == NDT_ALLFACES ||
dtype == NDT_ALLFACES_OPTIONAL ||
- dtype == NDT_GLASSLIKE_FRAMED_OPTIONAL ||
dtype == NDT_GLASSLIKE ||
dtype == NDT_GLASSLIKE_FRAMED ||
- dtype == NDT_ALLFACES) &&
+ dtype == NDT_GLASSLIKE_FRAMED_OPTIONAL) &&
ndef->get(c).walkable && c != biome->c_dust) {
VoxelArea::add_y(em, vi, 1);
vm->m_data[vi] = MapNode(biome->c_dust);