1
0
Fork 0

Make the property tree reading slightly more robust.

This commit is contained in:
curt 2003-07-31 01:43:57 +00:00
parent b4d0b6dcd4
commit 429a5067d8

View file

@ -209,8 +209,10 @@ FGInterpolateEnvironmentCtrl::read_table (const SGPropertyNode * node,
{
for (int i = 0; i < node->nChildren(); i++) {
const SGPropertyNode * child = node->getChild(i);
if (!strcmp(child->getName(), "entry") &&
child->getStringValue("elevation-ft", "")[0] != '\0') {
if ( strcmp(child->getName(), "entry") == 0
&& child->getStringValue("elevation-ft", "")[0] != '\0'
&& ( child->getDoubleValue("elevation-ft") > 0.1 || i == 0 ) )
{
bucket * b = new bucket;
if (i > 0)
b->environment.copy(table[i-1]->environment);