fix hang in fracturing algorithm

This commit is contained in:
Tomasz Wlostowski 2015-07-30 13:49:22 +02:00 committed by Maciej Suminski
parent 07ad6cb0bb
commit fb29373b4c
1 changed files with 2 additions and 2 deletions

View File

@ -350,7 +350,7 @@ static int processEdge( FractureEdgeSet& edges, FractureEdge* edge )
int dist = ( x - x_intersect );
if( dist > 0 && dist < min_dist )
if( dist >= 0 && dist < min_dist && (*i)->m_connected )
{
min_dist = dist;
x_nearest = x_intersect;
@ -362,7 +362,7 @@ static int processEdge( FractureEdgeSet& edges, FractureEdge* edge )
{
int count = 0;
FractureEdge* lead1 = new FractureEdge( true, VECTOR2I( x_nearest, y ), VECTOR2I( x, y ) );
FractureEdge* lead1 = new FractureEdge( true, VECTOR2I( x_nearest, y ), VECTOR2I( x, y ) );
FractureEdge* lead2 = new FractureEdge( true, VECTOR2I( x, y ), VECTOR2I( x_nearest, y ) );
FractureEdge* split_2 = new FractureEdge( true, VECTOR2I( x_nearest, y ), e_nearest->m_p2 );