1
0
Fork 0

Keep on constructing if node id is not found (segfaults if not caught)

This commit is contained in:
Christian Schmitt 2012-10-18 16:41:08 +02:00
parent e4e7d8bffd
commit 7d827457b9

View file

@ -200,11 +200,14 @@ void TGConstruct::AverageEdgeElevations( void )
/* Find this node, and update it's elevation */
int idx = nodes.find( faces.node );
TGNode node = nodes.get_node( idx );
if ( !node.GetFixedPosition() ) {
// set elevation as the average between all tiles that have it
nodes.SetElevation( idx, elevation );
if (idx != -1) {
TGNode node = nodes.get_node( idx );
if ( !node.GetFixedPosition() ) {
// set elevation as the average between all tiles that have it
nodes.SetElevation( idx, elevation );
}
}
}
}
}