]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AILocalTraffic.cxx
Recent SimGear changes seem to require more additions of config.h to FG in order...
[flightgear.git] / src / ATC / AILocalTraffic.cxx
index c8caac821946c6d8f78031921dd950f46ba40464..43d9b9485318541013fcbe50556bd8a1b59e5fbf 100644 (file)
@@ -17,7 +17,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.
 
 /*==========================================================
 
@@ -61,7 +61,6 @@ FGAILocalTraffic::FGAILocalTraffic() {
                                          globals->get_sim_time_sec() );
        *//*
        _model = model;
-       _model->ref();
        _aip.init(_model);
        */
        //SetModel(model);
@@ -125,7 +124,6 @@ FGAILocalTraffic::FGAILocalTraffic() {
 }
 
 FGAILocalTraffic::~FGAILocalTraffic() {
-       //_model->deRef();
 }
 
 void FGAILocalTraffic::GetAirportDetails(const string& id) {
@@ -156,7 +154,7 @@ void FGAILocalTraffic::GetAirportDetails(const string& id) {
                _controlled = false;
        }
        // Get the airport elevation
-       aptElev = dclGetAirportElev(airportID.c_str());
+       aptElev = fgGetAirportElev(airportID.c_str());
        //cout << "Airport elev in AILocalTraffic = " << aptElev << '\n';
        // WARNING - we use this elev for the whole airport - some assumptions in the code 
        // might fall down with very slopey airports.
@@ -1069,8 +1067,8 @@ void FGAILocalTraffic::FlyTrafficPattern(double dt) {
                if(descending) {
                        if(orthopos.y() < -50.0) {
                                double thesh_offset = 30.0;
-                               slope = atan((_pos.elev() - dclGetAirportElev(airportID)) / (orthopos.y() - thesh_offset)) * DCL_RADIANS_TO_DEGREES;
-                               //cout << "slope = " << slope << ", elev = " << _pos.elev() << ", apt_elev = " << dclGetAirportElev(airportID) << ", op.y = " << orthopos.y() << '\n';
+                               slope = atan((_pos.elev() - fgGetAirportElev(airportID)) / (orthopos.y() - thesh_offset)) * DCL_RADIANS_TO_DEGREES;
+                               //cout << "slope = " << slope << ", elev = " << _pos.elev() << ", apt_elev = " << fgGetAirportElev(airportID) << ", op.y = " << orthopos.y() << '\n';
                                if(slope < -10.0) slope = -10.0;
                                _savedSlope = slope;
                                _pitch = -4.0;