]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/approach.cxx
Fix the nmea and garmin output to a) fake a GSA sentence, b) fix a y2k bug
[flightgear.git] / src / ATC / approach.cxx
index 3e54ef5792dd603fc79ede2ce874c60221f17eda..2f291779755493443dc84b0854baf5ff2b278a73 100644 (file)
@@ -87,7 +87,7 @@ void FGApproach::Update(double dt) {
        const int max_trans = 20;
        FGTransmission tmissions[max_trans];
        int    wpn;
-       int    station = 1;
+       atc_type station = APPROACH;
        TransCode code;
        TransPar TPar;
        int    i,j;
@@ -111,7 +111,7 @@ void FGApproach::Update(double dt) {
        
        for (i=0; i<num_planes; i++) {
                if ( planes[i].ident == "Player") { 
-                       station = 1;
+                       station = APPROACH;
                        tpars.station = name;
                        tpars.callsign = "Player";
                        tpars.airport = ident;
@@ -125,15 +125,18 @@ void FGApproach::Update(double dt) {
                                // loop over all transmissions for station
                                for ( j=0; j<=num_trans-1; j++ ) {
                                        code = tmissions[j].get_code();
+                                       //cout << "code is " << code.c1 << "  " << code.c2 << "  " << code.c3 << '\n';
                                        // select proper transmissions
-                                       if ( ( code.c2 == -1 && planes[i].lmc.c3 == 0 ) || 
-                                               ( code.c1 == 0  && code.c2 == planes[i].lmc.c2 ) ) {
-                                               mentry = current_transmissionlist->gen_text(station, code, tpars, false);
-                                               transm = current_transmissionlist->gen_text(station, code, tpars, true);
-                                               // is the transmission already registered?
-                                               if (!current_atcdialog->trans_reg( ident, transm )) {
-                                                       current_atcdialog->add_entry( ident, transm, mentry );
-                                               }
+                                       if(code.c3 != 2) {    // DCL - hack to prevent request crossing airspace being displayed since this isn't implemented yet.
+                                           if ( ( code.c2 == -1 && planes[i].lmc.c3 == 0 ) || 
+                                                   ( code.c1 == 0  && code.c2 == planes[i].lmc.c2 ) ) {
+                                                   mentry = current_transmissionlist->gen_text(station, code, tpars, false);
+                                                   transm = current_transmissionlist->gen_text(station, code, tpars, true);
+                                                   // is the transmission already registered?
+                                                   if (!current_atcdialog->trans_reg( ident, transm, APPROACH )) {
+                                                           current_atcdialog->add_entry( ident, transm, mentry, APPROACH, 0 );
+                                                   }
+                                           }
                                        }
                                }
                        }
@@ -230,7 +233,7 @@ void FGApproach::Update(double dt) {
                                        tpars.alt = planes[i].aalt;
                                        message = current_transmissionlist->gen_text(station, code, tpars, true );
                                        //cout << "Approach transmitting...\n";
-                                       //cout << message << '\n';
+                                       //cout << message << endl;
                                        globals->get_ATC_display()->RegisterSingleMessage( message, 0 );
                                        
                                }
@@ -241,7 +244,7 @@ void FGApproach::Update(double dt) {
                                        tpars.runway = active_runway;
                                        message = current_transmissionlist->gen_text(station, code, tpars, true);
                                        //cout << "Approach transmitting 2 ...\n";
-                                       //cout << message << '\n';
+                                       //cout << message << endl;
                                        globals->get_ATC_display()->RegisterSingleMessage( message, 0 );
                                }
                                planes[i].lmc = code;