]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/atc_mgr.cxx
traffic: more pass by reference + member init
[flightgear.git] / src / ATC / atc_mgr.cxx
index 28639c910a588de7e5a59ace17aa36b7114a4b43..67d53c9fc05fdcd72336badf2db3f548ca6e462c 100644 (file)
@@ -48,6 +48,8 @@ void FGATCManager::init() {
 
     int leg = 0;
 
+    trans_num = globals->get_props()->getNode("/sim/atc/transmission-num", true);
+
     // find a reasonable controller for our user's aircraft..
     // Let's start by working out the following three scenarios: 
     // Starting on ground at a parking position
@@ -259,8 +261,7 @@ void FGATCManager::update ( double time ) {
         //string airport = fgGetString("/sim/presets/airport-id");
         //FGAirport *apt = FGAirport::findByIdent(airport); 
         // AT this stage we should update the flightplan, so that waypoint incrementing is conducted as well as leg loading. 
-       static SGPropertyNode_ptr trans_num = globals->get_props()->getNode("/sim/atc/transmission-num", true);
-            int n = trans_num->getIntValue();
+        int n = trans_num->getIntValue();
         if (n == 1) {
             //cerr << "Toggling ground network visibility " << networkVisible << endl;
             networkVisible = !networkVisible;