From: Rudolf Polzer Date: Sun, 27 Feb 2011 06:18:02 +0000 (+0100) Subject: if we get empty brushes in CSG subtract, don't complain, just don't insert the new... X-Git-Tag: xonotic-v0.5.0~39 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5b8b0dd6b2ed0067382c12b27a262f4b5d90272c;p=xonotic%2Fnetradiant.git 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) --- 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); }