Keep on constructing if node id is not found (segfaults if not caught)
This commit is contained in:
parent
e4e7d8bffd
commit
7d827457b9
1 changed files with 8 additions and 5 deletions
|
@ -200,11 +200,14 @@ void TGConstruct::AverageEdgeElevations( void )
|
||||||
|
|
||||||
/* Find this node, and update it's elevation */
|
/* Find this node, and update it's elevation */
|
||||||
int idx = nodes.find( faces.node );
|
int idx = nodes.find( faces.node );
|
||||||
TGNode node = nodes.get_node( idx );
|
|
||||||
|
|
||||||
if ( !node.GetFixedPosition() ) {
|
if (idx != -1) {
|
||||||
// set elevation as the average between all tiles that have it
|
TGNode node = nodes.get_node( idx );
|
||||||
nodes.SetElevation( idx, elevation );
|
|
||||||
|
if ( !node.GetFixedPosition() ) {
|
||||||
|
// set elevation as the average between all tiles that have it
|
||||||
|
nodes.SetElevation( idx, elevation );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue