]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
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 f30fb9808a1a6ca9180f7203e5bbd7672616a7be..a0afdeeb852efccb4fd4beea624cce24305713ca 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);
         }