]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/tower.cxx
If it's a struct, it's not a class
[flightgear.git] / src / ATC / tower.cxx
index d3a1113b85b36aca49c3b88d7ee1bf2a1e606403..c224c3d193610fbf6de54369407db572a902c2c3 100644 (file)
@@ -16,7 +16,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
@@ -204,13 +204,11 @@ FGTower::FGTower() {
        update_count_max = 15;
        
        holdListItr = holdList.begin();
-       appList.clear();
        appListItr = appList.begin();
        depListItr = depList.begin();
        rwyListItr = rwyList.begin();
        circuitListItr = circuitList.begin();
        trafficListItr = trafficList.begin();
-       vacatedList.clear();
        vacatedListItr = vacatedList.begin();
        
        freqClear = true;
@@ -658,7 +656,7 @@ void FGTower::ProcessDownwindReport(TowerPlaneRec* t) {
                trns += s;
                if((tt->opType) == CIRCUIT) {
                        PatternLeg leg;
-                       if(t->isUser) {
+                       if(tt->isUser) {
                                leg = tt->leg;
                        } else {
                                leg = tt->planePtr->GetLeg();
@@ -2173,7 +2171,9 @@ void FGTower::RemovePlane(const string& ID) {
                        t = *twrItr;
                        twrItr = appList.erase(twrItr);
                        appListItr = appList.begin();
-                       break;
+                       // HACK: aircraft are sometimes more than once in a list, so we need to
+                       // remove them all before we can delete the TowerPlaneRec class
+                       //break;
                }
        }
        for(twrItr = depList.begin(); twrItr != depList.end(); twrItr++) {
@@ -2181,7 +2181,7 @@ void FGTower::RemovePlane(const string& ID) {
                        t = *twrItr;
                        twrItr = depList.erase(twrItr);
                        depListItr = depList.begin();
-                       break;
+                       //break;
                }
        }
        for(twrItr = circuitList.begin(); twrItr != circuitList.end(); twrItr++) {
@@ -2189,7 +2189,7 @@ void FGTower::RemovePlane(const string& ID) {
                        t = *twrItr;
                        twrItr = circuitList.erase(twrItr);
                        circuitListItr = circuitList.begin();
-                       break;
+                       //break;
                }
        }
        for(twrItr = holdList.begin(); twrItr != holdList.end(); twrItr++) {
@@ -2197,7 +2197,7 @@ void FGTower::RemovePlane(const string& ID) {
                        t = *twrItr;
                        twrItr = holdList.erase(twrItr);
                        holdListItr = holdList.begin();
-                       break;
+                       //break;
                }
        }
        for(twrItr = rwyList.begin(); twrItr != rwyList.end(); twrItr++) {
@@ -2205,7 +2205,7 @@ void FGTower::RemovePlane(const string& ID) {
                        t = *twrItr;
                        twrItr = rwyList.erase(twrItr);
                        rwyListItr = rwyList.begin();
-                       break;
+                       //break;
                }
        }
        for(twrItr = vacatedList.begin(); twrItr != vacatedList.end(); twrItr++) {
@@ -2213,7 +2213,7 @@ void FGTower::RemovePlane(const string& ID) {
                        t = *twrItr;
                        twrItr = vacatedList.erase(twrItr);
                        vacatedListItr = vacatedList.begin();
-                       break;
+                       //break;
                }
        }
        for(twrItr = trafficList.begin(); twrItr != trafficList.end(); twrItr++) {
@@ -2221,7 +2221,7 @@ void FGTower::RemovePlane(const string& ID) {
                        t = *twrItr;
                        twrItr = trafficList.erase(twrItr);
                        trafficListItr = trafficList.begin();
-                       break;
+                       //break;
                }
        }
        // And finally, delete the record.