Vivian MEAZZA:
"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."
This commit is contained in:
parent
e2c195f3a6
commit
d47e4ce0bd
2 changed files with 11 additions and 10 deletions
|
@ -105,7 +105,7 @@ void FGAIAircraft::readFromScenario(SGPropertyNode* scFileNode) {
|
||||||
|
|
||||||
|
|
||||||
bool FGAIAircraft::init() {
|
bool FGAIAircraft::init() {
|
||||||
refuel_node = fgGetNode("systems/refuel/contact", true);
|
//refuel_node = fgGetNode("systems/refuel/contact", true);
|
||||||
return FGAIBase::init();
|
return FGAIBase::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ void FGAIAircraft::Run(double dt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// match pitch angle to vertical speed
|
// match pitch angle to vertical speed
|
||||||
if (vs > 0){
|
if (vs > 0) {
|
||||||
pitch = vs * 0.005;
|
pitch = vs * 0.005;
|
||||||
} else {
|
} else {
|
||||||
pitch = vs * 0.002;
|
pitch = vs * 0.002;
|
||||||
|
@ -433,7 +433,7 @@ void FGAIAircraft::Run(double dt) {
|
||||||
refuel_node->setBoolValue(true);
|
refuel_node->setBoolValue(true);
|
||||||
contact = true;
|
contact = true;
|
||||||
} else {
|
} else {
|
||||||
refuel_node->setBoolValue(false);
|
//refuel_node->setBoolValue(false);
|
||||||
contact = false;
|
contact = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -44,7 +44,7 @@ FGAIMultiplayer::~FGAIMultiplayer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FGAIMultiplayer::init() {
|
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
|
isTanker = false; // do this until this property is
|
||||||
// passed over the net
|
// passed over the net
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ bool FGAIMultiplayer::init() {
|
||||||
string str2 = "MOBIL";
|
string str2 = "MOBIL";
|
||||||
|
|
||||||
unsigned int loc1= str1.find( str2, 0 );
|
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;
|
// cout << " string found " << str2 << " in " << str1 << endl;
|
||||||
isTanker = true;
|
isTanker = true;
|
||||||
// cout << "isTanker " << isTanker << " " << mCallSign <<endl;
|
// cout << "isTanker " << isTanker << " " << mCallSign <<endl;
|
||||||
|
@ -322,12 +322,13 @@ void FGAIMultiplayer::update(double dt)
|
||||||
|
|
||||||
|
|
||||||
if ( isTanker) {
|
if ( isTanker) {
|
||||||
if ( (range_ft2 < 250.0 * 250.0)
|
if ( (range_ft2 < 250.0 * 250.0) &&
|
||||||
/*&& (y_shift > 0.0) && (elevation > 0.0)*/ ) {
|
(y_shift > 0.0) &&
|
||||||
refuel_node->setBoolValue(true);
|
(elevation > 0.0) ){
|
||||||
|
// refuel_node->setBoolValue(true);
|
||||||
contact = true;
|
contact = true;
|
||||||
} else {
|
} else {
|
||||||
refuel_node->setBoolValue(false);
|
// refuel_node->setBoolValue(false);
|
||||||
contact = false;
|
contact = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue