if we get empty brushes in CSG subtract, don't complain, just don't insert the new...
authorRudolf Polzer <divverent@xonotic.org>
Sun, 27 Feb 2011 06:18:02 +0000 (07:18 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 27 Feb 2011 06:18:02 +0000 (07:18 +0100)
radiant/csg.cpp

index f30fb98..a0afdee 100644 (file)
@@ -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);
         }