]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIEscort.cxx
Overhaul the ground-net / parking code.
[flightgear.git] / src / AIModel / AIEscort.cxx
index afe0ee8c92bb7f8fd6e8eff81728ee288d649d8a..8012ae9230ea2df4b5659bdfd0017ab1a62107fa 100644 (file)
@@ -190,13 +190,15 @@ bool FGAIEscort::getGroundElev(SGGeod inpos) {
 
     double height_m ;
 
-    if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(inpos, 3000), height_m, &_material,0)){
+    const simgear::BVHMaterial* mat = 0;
+    if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(inpos, 3000), height_m, &mat, 0)){
+        const SGMaterial* material = dynamic_cast<const SGMaterial*>(mat);
         _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());