Biome dust node: Only place on 'walkable' cubic non-liquid drawtypes
authorparamat <paramat@users.noreply.github.com>
Wed, 15 Nov 2017 23:52:31 +0000 (23:52 +0000)
committerSmallJoker <mk939@ymail.com>
Sun, 3 Jun 2018 15:32:00 +0000 (17:32 +0200)
No longer decide placement on 'buildable_to' parameter.
Dust nodes only look acceptable placed on cubic nodes.
Modders may not want to make their plantlike decorations 'buildable_to'.

src/mapgen.cpp

index 1aa3be3027a9b1e9ee507ce70e62275a63647f7e..f4165f5cd87e14484cb792029601707200b957a0 100644 (file)
@@ -809,7 +809,16 @@ void MapgenBasic::dustTopNodes()
                }
 
                content_t c = vm->m_data[vi].getContent();
-               if (!ndef->get(c).buildable_to && c != CONTENT_IGNORE && c != biome->c_dust) {
+               NodeDrawType dtype = ndef->get(c).drawtype;
+               // Only place on walkable cubic non-liquid nodes
+               // Dust check needed due to vertical overgeneration
+               if ((dtype == NDT_NORMAL ||
+                               dtype == NDT_ALLFACES_OPTIONAL ||
+                               dtype == NDT_GLASSLIKE_FRAMED_OPTIONAL ||
+                               dtype == NDT_GLASSLIKE ||
+                               dtype == NDT_GLASSLIKE_FRAMED ||
+                               dtype == NDT_ALLFACES) &&
+                               ndef->get(c).walkable && c != biome->c_dust) {
                        vm->m_area.add_y(em, vi, 1);
                        vm->m_data[vi] = MapNode(biome->c_dust);
                }