fixed delete voxel

This commit is contained in:
ZappoMan 2013-06-03 21:04:42 -07:00
parent cf3ff53e2c
commit 03f79f5cab

View file

@ -286,9 +286,9 @@ void VoxelTree::deleteVoxelCodeFromTree(unsigned char* codeBuffer, bool stage, b
} }
} }
// If we're not a colored leaf, and we have no children, then delete ourselves // If we're in collpaseEmptryTrees mode, and we're the last child of this parent, then delete the parent.
// This will collapse the empty tree above us. // This will collapse the empty tree above us.
if (collapseEmptyTrees && parentNode->getChildCount() == 0 && !parentNode->isColored()) { if (collapseEmptyTrees && parentNode->getChildCount() == 0) {
// Can't delete the root this way. // Can't delete the root this way.
if (parentNode != rootNode) { if (parentNode != rootNode) {
deleteVoxelCodeFromTree(parentNode->getOctalCode(), stage, collapseEmptyTrees); deleteVoxelCodeFromTree(parentNode->getOctalCode(), stage, collapseEmptyTrees);