From 5c56757303687f2d99d2c92eeb391bcac115dd00 Mon Sep 17 00:00:00 2001 From: frohlich Date: Mon, 7 Sep 2009 20:40:08 +0000 Subject: [PATCH] Move dynamic_casts to EffectGeode into the findMaterial method. Modified Files: src/Scenery/scenery.cxx --- src/Scenery/scenery.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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()); } } }