Hack to fix crash.

This commit is contained in:
David Williams 2009-06-23 21:01:31 +00:00
parent 1994155d07
commit 9d1f9e7959

View File

@ -116,6 +116,11 @@ namespace PolyVox
void IndexedSurfacePatch::smooth(float fAmount, bool bIncludeEdgeVertices) 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<SurfaceVertex> vecOriginalVertices = m_vecVertices; std::vector<SurfaceVertex> vecOriginalVertices = m_vecVertices;
Vector3DFloat offset = static_cast<Vector3DFloat>(m_Region.getLowerCorner()); Vector3DFloat offset = static_cast<Vector3DFloat>(m_Region.getLowerCorner());