]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AIMgr.cxx
Make sure the ATIS reports surface winds at airports above sea-level
[flightgear.git] / src / ATC / AIMgr.cxx
index 8f23a5507aa89e6336f5811e3fc9066bf663cef9..58e9886794a733ca20b4223998f68b370584987a 100644 (file)
@@ -56,6 +56,8 @@ FGAIMgr::FGAIMgr() {
 }
 
 FGAIMgr::~FGAIMgr() {
+       _defaultModel->deRef();
+       _piperModel->deRef();
 }
 
 void FGAIMgr::init() {
@@ -84,6 +86,10 @@ void FGAIMgr::init() {
                                     globals->get_props(),
                                     globals->get_sim_time_sec() );
 
+       // We need to keep one ref of the models open to stop ssg deleting them behind our back!
+       _defaultModel->ref();
+       _piperModel->ref();
+
        // go through the $FG_ROOT/ATC directory and find all *.taxi files
        SGPath path(globals->get_fg_root());
        path.append("ATC/");
@@ -107,7 +113,7 @@ void FGAIMgr::init() {
                                f_ident = file.substr(0, pos);
                                FGAirport a;
                                if(dclFindAirportID(f_ident, &a)) {
-                                       SGBucket sgb(a.longitude, a.latitude);
+                                       SGBucket sgb(a._longitude, a._latitude);
                                        int idx = sgb.gen_index();
                                        if(facilities.find(idx) != facilities.end()) {
                                                facilities[idx]->push_back(f_ident);