]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATCDCL/ATCDialogOld.cxx
Expose a radio function (receiveBeacon) to the Nasal subsystem
[flightgear.git] / src / ATCDCL / ATCDialogOld.cxx
index 026a6544928ef7b524535df8022d091d02147fa0..b1824180cbf5989bb22c79bb559b50913f81080c 100644 (file)
@@ -30,8 +30,9 @@
 #include <Main/globals.hxx>
 #include <GUI/gui.h>           // mkDialog
 #include <GUI/new_gui.hxx>
+#include <Main/fg_props.hxx>
 
-#include "ATCDialog.hxx"
+#include "ATCDialogOld.hxx"
 #include "ATC.hxx"
 #include "ATCmgr.hxx"
 #include "ATCutils.hxx"
@@ -41,6 +42,8 @@
 #include <sstream>
 
 using std::ostringstream;
+using std::cerr;
+using std::endl;
 
 FGATCDialog *current_atcdialog;
 
@@ -203,7 +206,13 @@ void FGATCDialog::PopupDialog() {
        button_group->removeChildren("button", false);
 
        string label;
-       FGATC* atcptr = globals->get_ATC_mgr()->GetComm1ATCPointer();   // Hardwired to comm1 at the moment
+       FGATCMgr* pAtcMgr = globals->get_ATC_mgr();
+       if (!pAtcMgr)
+       {
+           SG_LOG(SG_ATC, SG_ALERT, "ERROR! No ATC manager! Oops...");
+           return;
+       }
+       FGATC* atcptr = pAtcMgr->GetComm1ATCPointer();  // Hardwired to comm1 at the moment
 
        if (!atcptr) {
                label = "Not currently tuned to any ATC service";
@@ -258,7 +267,13 @@ void FGATCDialog::PopupDialog() {
 }
 
 void FGATCDialog::PopupCallback(int num) {
-       FGATC* atcptr = globals->get_ATC_mgr()->GetComm1ATCPointer();   // FIXME - Hardwired to comm1 at the moment
+    FGATCMgr* pAtcMgr = globals->get_ATC_mgr();
+    if (!pAtcMgr)
+    {
+        SG_LOG(SG_ATC, SG_ALERT, "ERROR! No ATC manager! Oops...");
+        return;
+    }
+       FGATC* atcptr = pAtcMgr->GetComm1ATCPointer();  // FIXME - Hardwired to comm1 at the moment
 
        if (!atcptr)
                return;