X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FEnvironment%2Fenvironment_ctrl.cxx;h=eb2761b12a58099081fbb36401c2e866c4004583;hb=79e48829da50e0103e81684896b8287bfe23cc96;hp=73c9d7b0407038a8a582772e0041a9a6f748155e;hpb=ee806b50a1d17e07c95583c7259b3e031418c63e;p=flightgear.git diff --git a/src/Environment/environment_ctrl.cxx b/src/Environment/environment_ctrl.cxx index 73c9d7b04..eb2761b12 100644 --- a/src/Environment/environment_ctrl.cxx +++ b/src/Environment/environment_ctrl.cxx @@ -172,7 +172,7 @@ FGInterpolateEnvironmentCtrl::FGInterpolateEnvironmentCtrl () FGInterpolateEnvironmentCtrl::~FGInterpolateEnvironmentCtrl () { - int i; + unsigned int i; for (i = 0; i < _boundary_table.size(); i++) delete _boundary_table[i]; for (i = 0; i < _aloft_table.size(); i++) @@ -193,7 +193,7 @@ FGInterpolateEnvironmentCtrl::init () void FGInterpolateEnvironmentCtrl::reinit () { - int i; + unsigned int i; for (i = 0; i < _boundary_table.size(); i++) delete _boundary_table[i]; for (i = 0; i < _aloft_table.size(); i++) @@ -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); @@ -231,7 +233,7 @@ FGInterpolateEnvironmentCtrl::update (double delta_time_sec) double boundary_transition = fgGetDouble("/environment/config/boundary-transition-ft", 500); - double ground_elevation_ft = altitude_ft - altitude_agl_ft; + // double ground_elevation_ft = altitude_ft - altitude_agl_ft; int length = _boundary_table.size();