]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIEscort.cxx
bvh: Adapt to upstream bvh changes in simgear.
[flightgear.git] / src / AIModel / AIEscort.cxx
index b3218ecee9879056a4aacd4a84c04dd14eb5192c..765cac8dbd9e5d9cffded5605df6fbd7d4b69e11 100644 (file)
@@ -27,8 +27,8 @@
 #include <vector>
 
 #include <simgear/sg_inlines.h>
-#include <simgear/math/SGMath.hxx>
 #include <simgear/math/sg_geodesy.hxx>
+#include <simgear/math/sg_random.h>
 
 #include <math.h>
 #include <Main/util.hxx>
@@ -190,13 +190,14 @@ bool FGAIEscort::getGroundElev(SGGeod inpos) {
 
     double height_m ;
 
-    if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(inpos, 3000), height_m, &_material,0)){
+    const SGMaterial* material = 0;
+    if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(inpos, 3000), height_m, &material,0)){
         _ht_agl_ft = inpos.getElevationFt() - height_m * SG_METER_TO_FEET;
 
-        if (_material) {
-            const vector<string>& names = _material->get_names();
+        if (material) {
+            const vector<string>& names = material->get_names();
 
-            _solid = _material->get_solid();
+            _solid = material->get_solid();
 
             if (!names.empty())
                 props->setStringValue("material/name", names[0].c_str());