diff --git a/src/Scenery/scenery.cxx b/src/Scenery/scenery.cxx index 4004b5b2c..5ca6ddd87 100644 --- a/src/Scenery/scenery.cxx +++ b/src/Scenery/scenery.cxx @@ -169,13 +169,8 @@ FGScenery::get_elevation_m(const SGGeod& geod, double& alt, if (alt < elevation) { alt = elevation; hits = true; - if (material) { - *material = 0; - const EffectGeode* eg - = dynamic_cast(hit.getGeode()); - if (eg) - *material = SGMaterialLib::findMaterial(eg->getEffect()); - } + if (material) + *material = SGMaterialLib::findMaterial(hit.getGeode()); } } }