aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHybrid Dog <ovvv@web.de>2017-06-05 18:52:34 +0200
committerparamat <mat.gregory@virginmedia.com>2017-08-14 12:38:21 +0100
commit4493d47a51dee4c785c009897ee4702850921503 (patch)
tree96f3de18591ff33d0a03252213f385a7cce1cfff
parent3eb9ff555f16110eccc38d06e6d9946f6f563f5c (diff)
downloadminetest-4493d47a51dee4c785c009897ee4702850921503.tar.gz
minetest-4493d47a51dee4c785c009897ee4702850921503.tar.bz2
minetest-4493d47a51dee4c785c009897ee4702850921503.zip
L-system: Fix leaves cutting through stems
-rw-r--r--src/treegen.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/treegen.cpp b/src/treegen.cpp
index 574cc034d..25f614d27 100644
--- a/src/treegen.cpp
+++ b/src/treegen.cpp
@@ -542,10 +542,13 @@ void tree_trunk_placement(MMVManip &vmanip, v3f p0, TreeDef &tree_definition)
if (vmanip.m_area.contains(p1) == false)
return;
u32 vi = vmanip.m_area.index(p1);
- if (vmanip.m_data[vi].getContent() != CONTENT_AIR
- && vmanip.m_data[vi].getContent() != CONTENT_IGNORE)
+ content_t current_node = vmanip.m_data[vi].getContent();
+ if (current_node != CONTENT_AIR && current_node != CONTENT_IGNORE
+ && current_node != tree_definition.leavesnode.getContent()
+ && current_node != tree_definition.leaves2node.getContent()
+ && current_node != tree_definition.fruitnode.getContent())
return;
- vmanip.m_data[vmanip.m_area.index(p1)] = tree_definition.trunknode;
+ vmanip.m_data[vi] = tree_definition.trunknode;
}