]> git.mxchange.org Git - flightgear.git/commitdiff
Vivian MEAZZA:
authormfranz <mfranz>
Mon, 22 May 2006 20:18:40 +0000 (20:18 +0000)
committermfranz <mfranz>
Mon, 22 May 2006 20:18:40 +0000 (20:18 +0000)
"Bug Fix - amend the code so that JSBSIm can have more than one tanker in
the environment at the same time. A nasal script has to be added to each
aar-capable JSBSim model to complete this fix."

src/AIModel/AIAircraft.cxx
src/AIModel/AIMultiplayer.cxx

index 853cd90b3ab75f16b858a585e15f4a48963242d5..d5e5f68ed7b927f3b74c6fec2f1527dee8d233d8 100644 (file)
@@ -105,7 +105,7 @@ void FGAIAircraft::readFromScenario(SGPropertyNode* scFileNode) {
 
 
 bool FGAIAircraft::init() {
-    refuel_node = fgGetNode("systems/refuel/contact", true);
+    //refuel_node = fgGetNode("systems/refuel/contact", true);
     return FGAIBase::init();
 }
 
@@ -412,7 +412,7 @@ void FGAIAircraft::Run(double dt) {
     }
 
     // match pitch angle to vertical speed
-    if (vs > 0){
+    if (vs > 0) {
         pitch = vs * 0.005;
     } else {
         pitch = vs * 0.002;
@@ -433,7 +433,7 @@ void FGAIAircraft::Run(double dt) {
             refuel_node->setBoolValue(true);
             contact = true;
         } else {
-            refuel_node->setBoolValue(false);
+            //refuel_node->setBoolValue(false);
             contact = false;
         }
     } else {
@@ -777,7 +777,7 @@ void FGAIAircraft::ProcessFlightPlan( double dt, time_t now ) {
                  << "pos : " << pos.lat() << ", " << pos.lon()
                  << "waypoint " << curr->latitude << ", " << curr->longitude << endl;
             cerr << "waypoint name " << curr->name;
-            exit(1);  // FIXME 
+            exit(1);  // FIXME
         }
 
         double speed_diff = speed - prevSpeed;
index 9502561bf46047c7e637f1f3a597bd3d16449bcd..89d90b593ca01b58a605c099aa9336f74048ba04 100755 (executable)
@@ -44,7 +44,7 @@ FGAIMultiplayer::~FGAIMultiplayer() {
 }
 
 bool FGAIMultiplayer::init() {
-    refuel_node = fgGetNode("systems/refuel/contact", true);
+    //refuel_node = fgGetNode("systems/refuel/contact", true);
     isTanker = false; // do this until this property is
                       // passed over the net
 
@@ -52,7 +52,7 @@ bool FGAIMultiplayer::init() {
     string str2 = "MOBIL";
 
     unsigned int loc1= str1.find( str2, 0 );
-    if ( (loc1 != string::npos && str2 != "") /*|| mCallSign == "mpdummy" */) {
+    if ( (loc1 != string::npos && str2 != "") ){
         //        cout << " string found "     << str2 << " in " << str1 << endl;
         isTanker = true;
         //        cout << "isTanker " << isTanker << " " << mCallSign <<endl;
@@ -322,12 +322,13 @@ void FGAIMultiplayer::update(double dt)
 
 
     if ( isTanker) {
-        if ( (range_ft2 < 250.0 * 250.0)
-                /*&& (y_shift > 0.0) && (elevation > 0.0)*/ ) {
-            refuel_node->setBoolValue(true);
+        if ( (range_ft2 < 250.0 * 250.0) &&
+            (y_shift > 0.0)    &&
+            (elevation > 0.0) ){
+                // refuel_node->setBoolValue(true);
             contact = true;
         } else {
-            refuel_node->setBoolValue(false);
+            // refuel_node->setBoolValue(false);
             contact = false;
         }
     } else {