]> git.mxchange.org Git - flightgear.git/blobdiff - src/Environment/environment_ctrl.cxx
Add Nasal Vs. 1.5
[flightgear.git] / src / Environment / environment_ctrl.cxx
index 73c9d7b0407038a8a582772e0041a9a6f748155e..eb2761b12a58099081fbb36401c2e866c4004583 100644 (file)
@@ -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();