]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIMultiplayer.cxx
Removed legacy interactive approach ATC
[flightgear.git] / src / AIModel / AIMultiplayer.cxx
old mode 100755 (executable)
new mode 100644 (file)
index d9b4430..476ddf2
@@ -29,6 +29,8 @@
 
 #include "AIMultiplayer.hxx"
 
+#include <simgear/scene/util/SGNodeMasks.hxx>
+
 // #define SG_DEBUG SG_ALERT
 
 FGAIMultiplayer::FGAIMultiplayer() : FGAIBase(otMultiplayer) {
@@ -37,6 +39,9 @@ FGAIMultiplayer::FGAIMultiplayer() : FGAIBase(otMultiplayer) {
    mTimeOffsetSet = false;
    mAllowExtrapolation = true;
    mLagAdjustSystemSpeed = 10;
+
+   aip.getSceneGraph()->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
+
 }
 
 
@@ -58,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)
@@ -92,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)
@@ -451,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;
     }