]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/ATCmgr.cxx
Melchior FRANZ:
[flightgear.git] / src / ATC / ATCmgr.cxx
index 8daf2e6becdeec34f67aa0cd735cffa85cb43dca..8084b0822d1704b246c7f8ec2453498a992f5974 100644 (file)
@@ -86,8 +86,8 @@ void FGATCMgr::unbind() {
 void FGATCMgr::init() {
        //cout << "ATCMgr::init called..." << endl;
        
-       comm_node[0] = fgGetNode("/radios/comm[0]/frequencies/selected-mhz", true);
-       comm_node[1] = fgGetNode("/radios/comm[1]/frequencies/selected-mhz", true);
+       comm_node[0] = fgGetNode("/instrumentation/comm[0]/frequencies/selected-mhz", true);
+       comm_node[1] = fgGetNode("/instrumentation/comm[1]/frequencies/selected-mhz", true);
        lon_node = fgGetNode("/position/longitude-deg", true);
        lat_node = fgGetNode("/position/latitude-deg", true);
        elev_node = fgGetNode("/position/altitude-ft", true);
@@ -117,9 +117,10 @@ void FGATCMgr::init() {
        voiceOK = v1->LoadVoice("default");
        voice = true;
        
-       /* I've loaded the voice even if /sim/sound/audible is false
+       /* I've loaded the voice even if /sim/sound/pause is true
        *  since I know no way of forcing load of the voice if the user
-       *  subsequently switches /sim/sound/audible to true. */
+       *  subsequently switches /sim/sound/audible to true.
+        *  (which is the right thing to do -- CLO) :-) */
 #else
        voice = false;
 #endif
@@ -220,9 +221,9 @@ bool FGATCMgr::AIRegisterAirport(string ident) {
                        //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.longitude;
-                       a->lat = ap.latitude;
-                       a->elev = ap.elevation;
+                       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;
@@ -269,9 +270,9 @@ bool FGATCMgr::CommRegisterAirport(string ident, int chan, atc_type tp) {
                if(dclFindAirportID(ident, &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.longitude;
-                       a->lat = ap.latitude;
-                       a->elev = ap.elevation;
+                       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);
@@ -373,7 +374,7 @@ void FGATCMgr::RemoveFromList(string id, atc_type tp) {
        while(it != atc_list.end()) {
                //cout << "type = " << (*it)->GetType() << '\n';
                //cout << "Ident = " << (*it)->get_ident() << '\n';
-               if( (!strcmp((*it)->get_ident(), id.c_str()))
+               if( ((*it)->get_ident() == id)
                        && ((*it)->GetType() == tp) ) {
                        //Before removing it stop it transmitting!!
                        //cout << "OBLITERATING FROM LIST!!!\n";
@@ -396,7 +397,7 @@ FGATC* FGATCMgr::FindInList(string id, atc_type tp) {
        //cout << "Entering FindInList for " << id << ' ' << tp << endl;
        atc_list_iterator it = atc_list.begin();
        while(it != atc_list.end()) {
-               if( (!strcmp((*it)->get_ident(), id.c_str()))
+               if( ((*it)->get_ident() == id)
                    && ((*it)->GetType() == tp) ) {
                        return(*it);
                }