Skip to content

Commit 4493d47

Browse files
HybridDogparamat
authored andcommittedAug 14, 2017
L-system: Fix leaves cutting through stems
1 parent 3eb9ff5 commit 4493d47

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎src/treegen.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -542,10 +542,13 @@ void tree_trunk_placement(MMVManip &vmanip, v3f p0, TreeDef &tree_definition)
542542
if (vmanip.m_area.contains(p1) == false)
543543
return;
544544
u32 vi = vmanip.m_area.index(p1);
545-
if (vmanip.m_data[vi].getContent() != CONTENT_AIR
546-
&& vmanip.m_data[vi].getContent() != CONTENT_IGNORE)
545+
content_t current_node = vmanip.m_data[vi].getContent();
546+
if (current_node != CONTENT_AIR && current_node != CONTENT_IGNORE
547+
&& current_node != tree_definition.leavesnode.getContent()
548+
&& current_node != tree_definition.leaves2node.getContent()
549+
&& current_node != tree_definition.fruitnode.getContent())
547550
return;
548-
vmanip.m_data[vmanip.m_area.index(p1)] = tree_definition.trunknode;
551+
vmanip.m_data[vi] = tree_definition.trunknode;
549552
}
550553

551554

0 commit comments

Comments
 (0)
Please sign in to comment.