From 9d1f9e795944c00fd90b8fac05ea361223ebce3a Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 23 Jun 2009 21:01:31 +0000 Subject: [PATCH] Hack to fix crash. --- library/PolyVoxCore/source/IndexedSurfacePatch.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/PolyVoxCore/source/IndexedSurfacePatch.cpp b/library/PolyVoxCore/source/IndexedSurfacePatch.cpp index 0fda1845..3cb2cb52 100644 --- a/library/PolyVoxCore/source/IndexedSurfacePatch.cpp +++ b/library/PolyVoxCore/source/IndexedSurfacePatch.cpp @@ -116,6 +116,11 @@ namespace PolyVox void IndexedSurfacePatch::smooth(float fAmount, bool bIncludeEdgeVertices) { + if(m_vecVertices.size() == 0) //FIXME - I don't think we should need this test, but I have seen crashes otherwise... + { + return; + } + std::vector vecOriginalVertices = m_vecVertices; Vector3DFloat offset = static_cast(m_Region.getLowerCorner());