]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/fdm_shell.cxx
Fix native protocol crashes.
[flightgear.git] / src / FDM / fdm_shell.cxx
index ac6466adedf8b2cd1b8f4c70abc0a978d329fe5d..21a3b79df7e0824168cb6d2e228e8051dcf9292d 100644 (file)
 #include <FDM/YASim/YASim.hxx>
 #endif
 
-/*
- * Evil global variable required by Network/FGNative,
- * see that class for more information
- */
-FGInterface* evil_global_fdm_state = NULL;
-
 FDMShell::FDMShell() :
   _tankProperties( fgGetNode("/consumables/fuel", true) ),
   _impl(NULL),
@@ -99,7 +93,6 @@ void FDMShell::reinit()
 {
   if (_impl) {
     fgSetBool("/sim/fdm-initialized", false);
-    evil_global_fdm_state = NULL;
     _impl->unbind();
     delete _impl;
     _impl = NULL;
@@ -146,7 +139,6 @@ void FDMShell::update(double dt)
         }
         _impl->bind();
         
-        evil_global_fdm_state = _impl;
         fgSetBool("/sim/fdm-initialized", true);
         fgSetBool("/sim/signals/fdm-initialized", true);
     }
@@ -196,6 +188,11 @@ void FDMShell::update(double dt)
   }
 }
 
+FGInterface* FDMShell::getInterface() const
+{
+    return _impl;
+}
+
 void FDMShell::createImplementation()
 {
   assert(!_impl);