From f8d1a58d6490a416b8c665aa26a0e10d5e055235 Mon Sep 17 00:00:00 2001 From: daveluff Date: Thu, 9 Oct 2003 11:52:42 +0000 Subject: [PATCH] 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 --- src/ATC/ATCmgr.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ATC/ATCmgr.cxx b/src/ATC/ATCmgr.cxx index fc300d1af..1fc8ceea7 100644 --- a/src/ATC/ATCmgr.cxx +++ b/src/ATC/ATCmgr.cxx @@ -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 - static int i = 0; + static int i = 0; // Very ugly - but there should only ever be one instance of FGATCMgr. + /* if(i == 7) { //cout << "About to AreaSearch()" << endl; AreaSearch(); } + */ if(i == 15) { //cout << "About to search(1)" << endl; FreqSearch(1); @@ -599,9 +601,11 @@ void FGATCMgr::FreqSearch(int channel) { // Generate the station and put in the ATC list FGApproach* a = new FGApproach; a->SetData(&data); + comm_atc_ptr[chan] = a; + a->SetDisplay(); + a->Init(); a->AddPlane("Player"); atc_list.push_back(a); - comm_atc_ptr[chan] = a; } } } else { @@ -619,7 +623,6 @@ void FGATCMgr::FreqSearch(int channel) { } } - // Search ATC stations by area in order that we appear 'on the radar' void FGATCMgr::AreaSearch() { // Search for Approach stations @@ -640,12 +643,14 @@ void FGATCMgr::AreaSearch() { FGATC* app = FindInList((app_itr->ident).c_str(), app_itr->type); if(app != NULL) { // The station is already in the ATC list + //cout << "In list adding player\n"; app->AddPlane("Player"); //app->Update(); } else { // Generate the station and put in the ATC list FGApproach* a = new FGApproach; a->SetData(&(*app_itr)); + //cout << "Adding player\n"; a->AddPlane("Player"); //a->Update(); atc_list.push_back(a); -- 2.39.5