]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIMultiplayer.cxx
Removed legacy interactive approach ATC
[flightgear.git] / src / AIModel / AIMultiplayer.cxx
index ab9cc5c3cf8915a8c1320908fb7eafe034adf908..476ddf205b54e1de4f3aa71ac315dab62ff240df 100644 (file)
@@ -63,14 +63,22 @@ bool FGAIMultiplayer::init(bool search_in_AI_path) {
         isTanker = true;
         //        cout << "isTanker " << isTanker << " " << mCallSign <<endl;
     }
-   return FGAIBase::init(search_in_AI_path);
+
+    // load model
+    bool result = FGAIBase::init(search_in_AI_path);
+    // propagate installation state (used by MP pilot list)
+    props->setBoolValue("model-installed", _installed);
+    return result;
 }
 
 void FGAIMultiplayer::bind() {
     FGAIBase::bind();
 
     props->tie("refuel/contact", SGRawValuePointer<bool>(&contact));
-    props->setBoolValue("tanker",isTanker);
+    props->tie("tanker", SGRawValuePointer<bool>(&isTanker));
+
+    props->tie("controls/invisible",
+        SGRawValuePointer<bool>(&invisible));
 
 #define AIMPROProp(type, name) \
 SGRawValueMethods<FGAIMultiplayer, type>(*this, &FGAIMultiplayer::get##name)
@@ -97,7 +105,10 @@ void FGAIMultiplayer::unbind() {
     //props->untie("callsign");
     props->untie("controls/allow-extrapolation");
     props->untie("controls/lag-adjust-system-speed");
+    props->untie("controls/invisible");
     props->untie("refuel/contact");
+    props->untie("tanker");
+
 }
 
 void FGAIMultiplayer::update(double dt)
@@ -456,16 +467,20 @@ void FGAIMultiplayer::update(double dt)
 
 
     if ( isTanker) {
+        //cout << "IS tanker ";
         if ( (range_ft2 < 250.0 * 250.0) &&
             (y_shift > 0.0)    &&
             (elevation > 0.0) ){
                 // refuel_node->setBoolValue(true);
+                 //cout << "in contact"  << endl;
             contact = true;
         } else {
             // refuel_node->setBoolValue(false);
+            //cout << "not in contact"  << endl;
             contact = false;
         }
     } else {
+        //cout << "NOT tanker " << endl;
         contact = false;
     }