1
0
Fork 0

Bug fixes to the AI/ATC interaction mechanism

This commit is contained in:
daveluff 2003-10-17 00:31:07 +00:00
parent c01b4dce67
commit 2666ce81d9
2 changed files with 6 additions and 2 deletions

View file

@ -78,6 +78,7 @@ void FGAIPlane::Update(double dt) {
// This turns on rendering if on the same freq as the user // 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. // TODO - turn it off if user switches to another freq - keep track of where in message we are etc.
if(_transmit) { if(_transmit) {
//cout << "transmit\n";
double user_freq0 = fgGetDouble("/radios/comm[0]/frequencies/selected-mhz"); double user_freq0 = fgGetDouble("/radios/comm[0]/frequencies/selected-mhz");
double user_freq1 = fgGetDouble("/radios/comm[1]/frequencies/selected-mhz"); double user_freq1 = fgGetDouble("/radios/comm[1]/frequencies/selected-mhz");
_counter = 0.0; _counter = 0.0;
@ -91,8 +92,6 @@ void FGAIPlane::Update(double dt) {
// For now assume in range !!! // For now assume in range !!!
// TODO - implement range checking // TODO - implement range checking
Render(plane.callsign, false); Render(plane.callsign, false);
_transmit = false;
_transmitting = true;
} }
} }
// Run the callback regardless of whether on same freq as user or not. // 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) { if(_callback_code) {
ProcessCallback(_callback_code); ProcessCallback(_callback_code);
} }
_transmit = false;
_transmitting = true;
} else if(_transmitting) { } else if(_transmitting) {
if(_counter >= _max_count) { if(_counter >= _max_count) {
NoRender(plane.callsign); NoRender(plane.callsign);

View file

@ -31,7 +31,10 @@
FGATC::FGATC() { FGATC::FGATC() {
freqClear = true; freqClear = true;
receiving = false;
respond = false;
runResponseCounter = false; runResponseCounter = false;
responseID = "";
responseReqd = false; responseReqd = false;
} }