Skip to content

Commit

Permalink
L-system: Fix leaves cutting through stems
Browse files Browse the repository at this point in the history
  • Loading branch information
HybridDog authored and paramat committed Aug 14, 2017
1 parent 3eb9ff5 commit 4493d47
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/treegen.cpp
Expand Up @@ -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;
}


Expand Down

0 comments on commit 4493d47

Please sign in to comment.