]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIAircraft.cxx
Tile manager improvements
[flightgear.git] / src / AIModel / AIAircraft.cxx
index 58db48478f8f4b413f92eccc3989d0de8a2f5864..52459a9cf823f7610fbdfd41065af24ad69f8d9f 100644 (file)
@@ -29,6 +29,7 @@
 #include <Scenery/scenery.hxx>
 #include <Scenery/tilemgr.hxx>
 #include <Airports/dynamics.hxx>
+#include <Airports/simple.hxx>
 
 #include <string>
 #include <math.h>
@@ -419,14 +420,12 @@ void FGAIAircraft::getGroundElev(double dt) {
         }
 
         double range = 500.0;
-        if (!globals->get_tile_mgr()->scenery_available(pos, range)) {
-            // Try to shedule tiles for that position.
-            globals->get_tile_mgr()->update( pos, range );
+        if (globals->get_tile_mgr()->schedule_scenery(pos, range, 5.0))
+        {
+            double alt;
+            if (getGroundElevationM(SGGeod::fromGeodM(pos, 20000), alt, 0))
+                tgt_altitude_ft = alt * SG_METER_TO_FEET;
         }
-
-        double alt;
-        if (getGroundElevationM(SGGeod::fromGeodM(pos, 20000), alt, 0))
-            tgt_altitude_ft = alt * SG_METER_TO_FEET;
     }
 }