]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/UFO.cxx
Bugfix: no automatic runway selection with --parkpos=
[flightgear.git] / src / FDM / UFO.cxx
index 81b532b5d78459c295ab0ca024ec3caa23f34209..93928f67d4bdddb30644d51f91137497622d28f8 100644 (file)
@@ -26,7 +26,6 @@
 #endif
 
 #include <simgear/math/sg_geodesy.hxx>
-#include <simgear/math/polar3d.hxx>
 
 #include <Aircraft/controls.hxx>
 #include <Main/globals.hxx>
@@ -155,7 +154,7 @@ void FGUFO::update( double dt ) {
     double yaw = fabs(rudder) < .2 ? 0.0 : rudder / (25 + fabs(speed) * .1);
 
     // update (lon/lat) position
-    double lat2, lon2, az2;
+    double lat2 = 0.0, lon2 = 0.0, az2 = 0.0;
     if ( fabs(speed) > SG_EPSILON ) {
         geo_direct_wgs_84 ( get_Altitude(),
                             get_Latitude() * SGD_RADIANS_TO_DEGREES,
@@ -163,8 +162,7 @@ void FGUFO::update( double dt ) {
                             get_Psi() * SGD_RADIANS_TO_DEGREES,
                             dist, &lat2, &lon2, &az2 );
 
-        _set_Longitude( lon2 * SGD_DEGREES_TO_RADIANS );
-        _set_Latitude( lat2 * SGD_DEGREES_TO_RADIANS );
+        _set_Geodetic_Position( lat2 * SGD_DEGREES_TO_RADIANS,  lon2 * SGD_DEGREES_TO_RADIANS );
     }
 
     // cout << "lon error = " << fabs(end.x()*SGD_RADIANS_TO_DEGREES - lon2)