]> git.mxchange.org Git - flightgear.git/commitdiff
Bug fixes to the AI/ATC interaction mechanism
authordaveluff <daveluff>
Fri, 17 Oct 2003 00:31:07 +0000 (00:31 +0000)
committerdaveluff <daveluff>
Fri, 17 Oct 2003 00:31:07 +0000 (00:31 +0000)
src/ATC/AIPlane.cxx
src/ATC/ATC.cxx

index 22729b4c5aac35d33dd6a99ecbd1f0bfaca48a28..3594e5e70f82a02d98d946807afff684f9404057 100644 (file)
@@ -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);
index 0695f7e440bc9e5914afb84f8ff752c769372c23..3ff154cb3e839c77dd44963382b58750929c7006 100644 (file)
 
 FGATC::FGATC() {
        freqClear = true;
+       receiving = false;
+       respond = false;
        runResponseCounter = false;
+       responseID = "";
        responseReqd = false;
 }