Fix trees growing into any type of node
authorIlya Zhuravlev <zhuravlevilya@ya.ru>
Thu, 22 Nov 2012 20:36:52 +0000 (00:36 +0400)
committerIlya Zhuravlev <zhuravlevilya@ya.ru>
Thu, 22 Nov 2012 20:36:52 +0000 (00:36 +0400)
src/mapgen.cpp

index 77b133020d7a094f64f87037c523e950687045a2..782f00b62bb0de7e7e10c0285b0f7d3d2bfe4f10 100644 (file)
@@ -132,7 +132,8 @@ void make_tree(ManualMapVoxelManipulator &vmanip, v3s16 p0,
        for(s16 ii=0; ii<trunk_h; ii++)
        {
                if(vmanip.m_area.contains(p1))
-                       vmanip.m_data[vmanip.m_area.index(p1)] = treenode;
+                       if(ii == 0 || vmanip.getNodeNoExNoEmerge(p1).getContent() == CONTENT_AIR)
+                               vmanip.m_data[vmanip.m_area.index(p1)] = treenode;
                p1.Y++;
        }