]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/ATCmgr.cxx
don't set the callsign, but use the set one
[flightgear.git] / src / ATC / ATCmgr.cxx
index 6aa95a547c2ae743bb89d352422a048420280bf2..dfb483ace3408538a803713ee0534a5ffdf48e94 100644 (file)
@@ -21,7 +21,6 @@
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/debug/logstream.hxx>
 #include <Airports/simple.hxx>
-
 #include "ATCmgr.hxx"
 #include "commlist.hxx"
 #include "ATCdisplay.hxx"
@@ -106,9 +105,6 @@ void FGATCMgr::init() {
     SGPath p_comm( globals->get_fg_root() );
     current_commlist->init( p_comm );
        
-       // Set the user callsign - bit of a hack at the moment - eventually should be read from aircraft file and user-over-rideable
-       fgSetString("/sim/user/callsign", "Golf Foxtrot Sierra");       // C-FGFS
-
 #ifdef ENABLE_AUDIO_SUPPORT    
        // Load all available voices.
        // For now we'll do one hardwired one
@@ -216,14 +212,14 @@ bool FGATCMgr::AIRegisterAirport(const string& ident) {
                airport_atc_map[ident]->numAI++;
                return(true);
        } else {
-               FGAirport ap;
-               if(dclFindAirportID(ident, &ap)) {
+               const FGAirport *ap = fgFindAirportID(ident);
+               if (ap) {
                        //cout << "ident = " << ident << '\n';
                        AirportATC *a = new AirportATC;
                        // I'm not entirely sure that this AirportATC structure business is actually needed - it just duplicates what we can find out anyway!
-                       a->lon = ap.getLongitude();
-                       a->lat = ap.getLatitude();
-                       a->elev = ap.getElevation();
+                       a->lon = ap->getLongitude();
+                       a->lat = ap->getLatitude();
+                       a->elev = ap->getElevation();
                        a->atis_freq = GetFrequency(ident, ATIS);
                        //cout << "ATIS freq = " << a->atis_freq << '\n';
                        a->atis_active = false;
@@ -266,13 +262,13 @@ bool FGATCMgr::CommRegisterAirport(const string& ident, int chan, const atc_type
                return(true);
        } else {
                //cout << "NOT IN MAP - creating new..." << endl;
-               FGAirport ap;
-               if(dclFindAirportID(ident, &ap)) {
+               const FGAirport *ap = fgFindAirportID(ident);
+               if (ap) {
                        AirportATC *a = new AirportATC;
                        // I'm not entirely sure that this AirportATC structure business is actually needed - it just duplicates what we can find out anyway!
-                       a->lon = ap.getLongitude();
-                       a->lat = ap.getLatitude();
-                       a->elev = ap.getElevation();
+                       a->lon = ap->getLongitude();
+                       a->lat = ap->getLatitude();
+                       a->elev = ap->getElevation();
                        a->atis_freq = GetFrequency(ident, ATIS);
                        a->atis_active = false;
                        a->tower_freq = GetFrequency(ident, TOWER);