Don't do AreaSearch in ATCmgr since nothing really needs it at the moment plus a couple of bug fixes to frequency search handling of approach
This commit is contained in:
parent
b84cf7c3af
commit
f8d1a58d64
1 changed files with 8 additions and 3 deletions
|
@ -161,11 +161,13 @@ void FGATCMgr::update(double dt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search the tuned frequencies every now and then - this should be done with the event scheduler
|
// Search the tuned frequencies every now and then - this should be done with the event scheduler
|
||||||
static int i = 0;
|
static int i = 0; // Very ugly - but there should only ever be one instance of FGATCMgr.
|
||||||
|
/*
|
||||||
if(i == 7) {
|
if(i == 7) {
|
||||||
//cout << "About to AreaSearch()" << endl;
|
//cout << "About to AreaSearch()" << endl;
|
||||||
AreaSearch();
|
AreaSearch();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if(i == 15) {
|
if(i == 15) {
|
||||||
//cout << "About to search(1)" << endl;
|
//cout << "About to search(1)" << endl;
|
||||||
FreqSearch(1);
|
FreqSearch(1);
|
||||||
|
@ -599,9 +601,11 @@ void FGATCMgr::FreqSearch(int channel) {
|
||||||
// Generate the station and put in the ATC list
|
// Generate the station and put in the ATC list
|
||||||
FGApproach* a = new FGApproach;
|
FGApproach* a = new FGApproach;
|
||||||
a->SetData(&data);
|
a->SetData(&data);
|
||||||
|
comm_atc_ptr[chan] = a;
|
||||||
|
a->SetDisplay();
|
||||||
|
a->Init();
|
||||||
a->AddPlane("Player");
|
a->AddPlane("Player");
|
||||||
atc_list.push_back(a);
|
atc_list.push_back(a);
|
||||||
comm_atc_ptr[chan] = a;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -619,7 +623,6 @@ void FGATCMgr::FreqSearch(int channel) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Search ATC stations by area in order that we appear 'on the radar'
|
// Search ATC stations by area in order that we appear 'on the radar'
|
||||||
void FGATCMgr::AreaSearch() {
|
void FGATCMgr::AreaSearch() {
|
||||||
// Search for Approach stations
|
// Search for Approach stations
|
||||||
|
@ -640,12 +643,14 @@ void FGATCMgr::AreaSearch() {
|
||||||
FGATC* app = FindInList((app_itr->ident).c_str(), app_itr->type);
|
FGATC* app = FindInList((app_itr->ident).c_str(), app_itr->type);
|
||||||
if(app != NULL) {
|
if(app != NULL) {
|
||||||
// The station is already in the ATC list
|
// The station is already in the ATC list
|
||||||
|
//cout << "In list adding player\n";
|
||||||
app->AddPlane("Player");
|
app->AddPlane("Player");
|
||||||
//app->Update();
|
//app->Update();
|
||||||
} else {
|
} else {
|
||||||
// Generate the station and put in the ATC list
|
// Generate the station and put in the ATC list
|
||||||
FGApproach* a = new FGApproach;
|
FGApproach* a = new FGApproach;
|
||||||
a->SetData(&(*app_itr));
|
a->SetData(&(*app_itr));
|
||||||
|
//cout << "Adding player\n";
|
||||||
a->AddPlane("Player");
|
a->AddPlane("Player");
|
||||||
//a->Update();
|
//a->Update();
|
||||||
atc_list.push_back(a);
|
atc_list.push_back(a);
|
||||||
|
|
Loading…
Add table
Reference in a new issue