]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATCDCL/AILocalTraffic.cxx
Initial commit of the new sound system, expect more updates to follow
[flightgear.git] / src / ATCDCL / AILocalTraffic.cxx
index 0e81570aeb5b9f1c7137ab19b3a777556f3609c0..2acf7d10dd612f9c027b3be771431d8ca50fc794 100644 (file)
@@ -546,6 +546,7 @@ void FGAILocalTraffic::Update(double dt) {
                // And to avoid compiler warnings...
                case APPROACH:  break;
                case ATIS:      break;
+    case AWOS:      break;
                case ENROUTE:   break;
                case DEPARTURE: break;
                case INVALID:   break;
@@ -1539,21 +1540,21 @@ void FGAILocalTraffic::DoGroundElev() {
        // Only do the proper hitlist stuff if we are within visible range of the viewer.
        double visibility_meters = fgGetDouble("/environment/visibility-m");
        FGViewer* vw = globals->get_current_view();
-       if(dclGetHorizontalSeparation(_pos, SGGeod::fromDegM(vw->getLongitude_deg(), vw->getLatitude_deg(), 0.0)) > visibility_meters) {
+       if(dclGetHorizontalSeparation(_pos, SGGeod::fromGeodM(vw->getPosition(), 0.0)) > visibility_meters) {
                _ground_elevation_m = aptElev;
                return;
        }
 
-        // FIXME: make shure the pos.lat/pos.lon values are in degrees ...
-        double range = 500.0;
-        if (!globals->get_tile_mgr()->scenery_available(_aip.getPosition(), range)) {
-          // Try to shedule tiles for that position.
-          globals->get_tile_mgr()->update( _aip.getPosition(), range );
-        }
+  // FIXME: make shure the pos.lat/pos.lon values are in degrees ...
+  double range = 500.0;
+  if (!globals->get_tile_mgr()->scenery_available(_aip.getPosition(), range)) {
+    // Try to shedule tiles for that position.
+    globals->get_tile_mgr()->update( _aip.getPosition(), range );
+  }
 
-        // FIXME: make shure the pos.lat/pos.lon values are in degrees ...
-        double alt;
-        if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(_aip.getPosition(), 20000), alt, 0))
-          _ground_elevation_m = alt;
+  // FIXME: make shure the pos.lat/pos.lon values are in degrees ...
+  double alt;
+  if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(_aip.getPosition(), 20000), alt, 0, _aip.getSceneGraph()))
+    _ground_elevation_m = alt;
 }