X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAIEscort.cxx;h=8012ae9230ea2df4b5659bdfd0017ab1a62107fa;hb=afcdbd3158503773644aa07dd86cd92d67946bd4;hp=b3218ecee9879056a4aacd4a84c04dd14eb5192c;hpb=89b41395d861a49ad543af166c0bd41c14dd0d2b;p=flightgear.git diff --git a/src/AIModel/AIEscort.cxx b/src/AIModel/AIEscort.cxx index b3218ecee..8012ae923 100644 --- a/src/AIModel/AIEscort.cxx +++ b/src/AIModel/AIEscort.cxx @@ -27,8 +27,8 @@ #include #include -#include #include +#include #include #include
@@ -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(mat); _ht_agl_ft = inpos.getElevationFt() - height_m * SG_METER_TO_FEET; - if (_material) { - const vector& names = _material->get_names(); + if (material) { + const vector& names = material->get_names(); - _solid = _material->get_solid(); + _solid = material->get_solid(); if (!names.empty()) props->setStringValue("material/name", names[0].c_str());