From: daveluff Date: Fri, 17 Oct 2003 00:31:07 +0000 (+0000) Subject: Bug fixes to the AI/ATC interaction mechanism X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2666ce81d914f13988a8e0b14e3d9888e567d348;p=flightgear.git Bug fixes to the AI/ATC interaction mechanism --- diff --git a/src/ATC/AIPlane.cxx b/src/ATC/AIPlane.cxx index 22729b4c5..3594e5e70 100644 --- a/src/ATC/AIPlane.cxx +++ b/src/ATC/AIPlane.cxx @@ -78,6 +78,7 @@ void FGAIPlane::Update(double dt) { // This turns on rendering if on the same freq as the user // TODO - turn it off if user switches to another freq - keep track of where in message we are etc. if(_transmit) { + //cout << "transmit\n"; double user_freq0 = fgGetDouble("/radios/comm[0]/frequencies/selected-mhz"); double user_freq1 = fgGetDouble("/radios/comm[1]/frequencies/selected-mhz"); _counter = 0.0; @@ -91,8 +92,6 @@ void FGAIPlane::Update(double dt) { // For now assume in range !!! // TODO - implement range checking Render(plane.callsign, false); - _transmit = false; - _transmitting = true; } } // Run the callback regardless of whether on same freq as user or not. @@ -100,6 +99,8 @@ void FGAIPlane::Update(double dt) { if(_callback_code) { ProcessCallback(_callback_code); } + _transmit = false; + _transmitting = true; } else if(_transmitting) { if(_counter >= _max_count) { NoRender(plane.callsign); diff --git a/src/ATC/ATC.cxx b/src/ATC/ATC.cxx index 0695f7e44..3ff154cb3 100644 --- a/src/ATC/ATC.cxx +++ b/src/ATC/ATC.cxx @@ -31,7 +31,10 @@ FGATC::FGATC() { freqClear = true; + receiving = false; + respond = false; runResponseCounter = false; + responseID = ""; responseReqd = false; }