From: frohlich Date: Mon, 7 Sep 2009 20:40:08 +0000 (+0000) Subject: Move dynamic_casts to EffectGeode into the findMaterial method. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5c56757303687f2d99d2c92eeb391bcac115dd00;p=flightgear.git Move dynamic_casts to EffectGeode into the findMaterial method. Modified Files: src/Scenery/scenery.cxx --- 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()); } } }