]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/native_ctrls.cxx
Merge branch 'master' of git://gitorious.org/fg/flightgear into next
[flightgear.git] / src / Network / native_ctrls.cxx
index a5816052c92e7084dc0f5e4af3bf74bb5e8f7d72..2ad871f834f28387b39baebd9cb1eea00661e054 100644 (file)
@@ -29,7 +29,6 @@
 #include <simgear/io/iochannel.hxx>
 #include <simgear/io/lowlevel.hxx> // endian tests
 
-#include <FDM/flight.hxx>
 #include <Main/fg_props.hxx>
 #include <Scenery/scenery.hxx> // ground elevation
 
@@ -39,7 +38,7 @@
 #if defined( _MSC_VER )
 #  include <windows.h>
 #elif defined( __MINGW32__ )
-#  include <Winsock2.h>
+#  include <winsock2.h>
 #else
 #  include <netinet/in.h>      // htonl() ntohl()
 #endif
@@ -205,12 +204,7 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
     net->temp_c = fgGetDouble("/environment/temperature-degc");
     net->press_inhg = fgGetDouble("/environment/pressure-sea-level-inhg");
 
-    // cur_fdm_state->get_ground_elev_ft() is what we want ... this
-    // reports the altitude of the aircraft.
-    // "/environment/ground-elevation-m" reports the ground elevation
-    // of the current view point which could change substantially if
-    // the user is switching views.
-    net->hground = cur_fdm_state->get_ground_elev_ft() * SG_FEET_TO_METER;
+    net->hground = fgGetDouble("/position/ground-elev-m");
     net->magvar = fgGetDouble("/environment/magnetic-variation-deg");
 
     net->icing = fgGetBool("/hazards/icing/wing");
@@ -436,7 +430,7 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes,
     node->setDoubleValue( "wind-speed-kt", net->wind_speed_kt );
     node->setDoubleValue( "wind-from-heading-deg", net->wind_dir_deg );
     node->setDoubleValue( "turbulence/magnitude-norm", net->turbulence_norm );
-    node->setBoolValue( "magnetic-variation-deg", net->magvar );
+    node->setDoubleValue( "magnetic-variation-deg", net->magvar );
 
     node->setDoubleValue( "/environment/temperature-degc",
                          net->temp_c );
@@ -469,7 +463,6 @@ bool FGNativeCtrls::process() {
     int length = sizeof(FGNetCtrls);
 
     if ( get_direction() == SG_IO_OUT ) {
-       // cout << "size of cur_fdm_state = " << length << endl;
 
        FGProps2NetCtrls( &net_ctrls, true, true );