From 5b8b0dd6b2ed0067382c12b27a262f4b5d90272c Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 27 Feb 2011 07:18:02 +0100 Subject: [PATCH] if we get empty brushes in CSG subtract, don't complain, just don't insert the new brush (as this can happen intentionally when a brush is entirely covered) --- radiant/csg.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/radiant/csg.cpp b/radiant/csg.cpp index f30fb980..a0afdeeb 100644 --- a/radiant/csg.cpp +++ b/radiant/csg.cpp @@ -397,12 +397,16 @@ public: for(brush_vector_t::const_iterator i = out.begin(); i != out.end(); ++i) { ++m_after; - NodeSmartReference node((new BrushNode())->node()); (*i)->removeEmptyFaces(); - ASSERT_MESSAGE(!(*i)->empty(), "brush left with no faces after subtract"); - Node_getBrush(node)->copy(*(*i)); - delete (*i); - Node_getTraversable(path.parent())->insert(node); + if(!(*i)->empty()) + { + NodeSmartReference node((new BrushNode())->node()); + Node_getBrush(node)->copy(*(*i)); + delete (*i); + Node_getTraversable(path.parent())->insert(node); + } + else + delete (*i); } Path_deleteTop(path); } -- 2.39.2