]> git.mxchange.org Git - flightgear.git/commitdiff
Vivian MEAZZA:
authormfranz <mfranz>
Sat, 13 May 2006 09:06:57 +0000 (09:06 +0000)
committermfranz <mfranz>
Sat, 13 May 2006 09:06:57 +0000 (09:06 +0000)
"Preparations for an upgrade to Air-to-Air Refuelling to allow more than one
tanker in the environment at a time. This will only work with YASim models.
JSBSim models are unaffected by this change."

src/AIModel/AIAircraft.cxx
src/AIModel/AIAircraft.hxx

index a7ffc210decc7b06139efbb48193899492ab432d..cbb17ed62d04020b340392814f7bbbd27846b46d 100644 (file)
@@ -111,14 +111,17 @@ void FGAIAircraft::bind() {
     props->tie("controls/gear/gear-down",
                SGRawValueMethods<FGAIAircraft,bool>(*this,
                                               &FGAIAircraft::_getGearDown));
+    props->tie("refuel/contact", SGRawValuePointer<bool>(&contact));
     props->setStringValue("callsign", callsign.c_str());
     props->setStringValue("navaids/tacan/channel-ID", TACAN_channel_id.c_str());
+    props->setBoolValue("tanker",isTanker);
 }
 
 void FGAIAircraft::unbind() {
     FGAIBase::unbind();
 
     props->untie("controls/gear/gear-down");
+    props->untie("refuel/contact");
 }
 
 
@@ -426,9 +429,13 @@ void FGAIAircraft::Run(double dt) {
           (y_shift > 0.0)    &&
           (elevation > 0.0) ) {
        refuel_node->setBoolValue(true);
+       contact = true;
      } else {
        refuel_node->setBoolValue(false);
+       contact = false;
      } 
+   } else {
+       contact = false;
    }
 }
 
index 1fc46f1a390e54d34b558a607b983d4042ae329f..36d315f7ac5fd9599275a65b4f8e07ed3125f466 100644 (file)
@@ -118,6 +118,7 @@ private:
   bool reachedWaypoint;
         string callsign;                      // The callsign of this tanker.
         string TACAN_channel_id;              // The TACAN channel of this tanker
+  bool contact;                               // set if this tanker is within fuelling range
 };