]> git.mxchange.org Git - flightgear.git/commitdiff
Avoid crashing in hla initialization failure.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Sun, 5 Jun 2011 11:44:37 +0000 (13:44 +0200)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Sun, 5 Jun 2011 11:45:40 +0000 (13:45 +0200)
src/Network/HLA/hla.cxx

index de12ae2f10d52ec8de27ed0022ec42776540db35..cf6af5effdebf480c52d92e91bdf1851b6c657d5 100644 (file)
@@ -1216,6 +1216,9 @@ FGHLA::open()
 bool
 FGHLA::process()
 {
+    if (!is_enabled())
+        return false;
+
     // First push our own data so that others can recieve ...
     if (get_direction() & SG_IO_OUT) {
         if (fgGetBool("/sim/fdm-initialized", false) && _localAircraftClass.valid()) {
@@ -1245,6 +1248,9 @@ FGHLA::process()
 bool
 FGHLA::close()
 {
+    if (!is_enabled())
+        return false;
+
     if (get_direction() & SG_IO_OUT) {
         // Remove the local object from the rti
         _localAircraftInstance->deleteInstance(simgear::RTIData("gone"));