]> git.mxchange.org Git - flightgear.git/commitdiff
Fix an uninitialized data condition that crept in during the recent
authorandy <andy>
Fri, 10 Mar 2006 19:47:23 +0000 (19:47 +0000)
committerandy <andy>
Fri, 10 Mar 2006 19:47:23 +0000 (19:47 +0000)
groundcache addition -- the ground callback doesn't do anything at
solution time, so the ground plane was unset.  Valgrind was whining
about this; it's not clear that it was actually causing a problem.

src/FDM/YASim/Airplane.cpp
src/FDM/YASim/Model.cpp

index df9dfbe604e3e4125a2cbaef9bc794571402a2b0..e9763673e3eecce6741a1ea2ec9665349a4f31a0 100644 (file)
@@ -677,11 +677,12 @@ void Airplane::compile()
     }
 
     // Ground effect
-    float gepos[3];
-    float gespan = 0;
-    if(_wing)
-      gespan = _wing->getGroundEffect(gepos);
-    _model.setGroundEffect(gepos, gespan, 0.15f);
+    if(_wing) {
+        float gepos[3];
+        float gespan = 0;
+        gespan = _wing->getGroundEffect(gepos);
+        _model.setGroundEffect(gepos, gespan, 0.15f);
+    }
 
     solveGear();
     if(_wing && _tail) solve();
index ece48823db53c3f4a6be4eb09d45d0963f4c77cd..e38de251564d86b18c791d0419c0ba51880a8f09 100644 (file)
@@ -60,6 +60,14 @@ Model::Model()
     _ground_cb = new Ground();
     _hook = 0;
     _launchbar = 0;
+
+    _groundEffectSpan = 0;
+    _groundEffect = 0;
+    for(i=0; i<3; i++) _wingCenter[i] = 0;
+
+    _global_ground[0] = 0; _global_ground[1] = 0; _global_ground[2] = 1;
+    _global_ground[3] = -100000;
+
 }
 
 Model::~Model()