]> git.mxchange.org Git - flightgear.git/commitdiff
Move dynamic_casts to EffectGeode into the findMaterial method.
authorfrohlich <frohlich>
Mon, 7 Sep 2009 20:40:08 +0000 (20:40 +0000)
committerTim Moore <timoore@redhat.com>
Wed, 9 Sep 2009 06:56:31 +0000 (08:56 +0200)
Modified Files:
src/Scenery/scenery.cxx

src/Scenery/scenery.cxx

index 4004b5b2c6aa74e57adcb8b5eff4d22844852506..5ca6ddd87f30d6bc53504de9cc48ddbb7e420aa6 100644 (file)
@@ -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<const EffectGeode*>(hit.getGeode());
-          if (eg)
-            *material = SGMaterialLib::findMaterial(eg->getEffect());
-        }
+        if (material)
+          *material = SGMaterialLib::findMaterial(hit.getGeode());
       }
     }
   }