]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIAircraft.cxx
- Added ultra-light traffic is now a separate traffic class that can have its
[flightgear.git] / src / AIModel / AIAircraft.cxx
index 897801b02fe8f8b96bdc65f2a66c2106ebc755f9..39c97f8622fd77598caf73e8cd970a7c65a36e99 100644 (file)
@@ -113,10 +113,6 @@ void FGAIAircraft::bind() {
     props->tie("controls/gear/gear-down",
                SGRawValueMethods<FGAIAircraft,bool>(*this,
                                                     &FGAIAircraft::_getGearDown));
-    props->tie("callsign",
-               SGRawValueMethods<FGAIAircraft,const char *>(*this,
-                                                    &FGAIAircraft::_getCallSign));
-    //props->setStringValue("callsign", callsign.c_str());
 }
 
 
@@ -124,7 +120,6 @@ void FGAIAircraft::unbind() {
     FGAIBase::unbind();
 
     props->untie("controls/gear/gear-down");
-    props->untie("callsign");
 }
 
 
@@ -325,10 +320,6 @@ bool FGAIAircraft::_getGearDown() const {
     return _performance->gearExtensible(this);
 }
 
-const char * FGAIAircraft::_getCallSign() const {
-    return callsign.c_str();
-}
-
 
 void FGAIAircraft::loadNextLeg() {
 
@@ -410,11 +401,6 @@ void FGAIAircraft::getGroundElev(double dt) {
 }
 
 
-void FGAIAircraft::setCallSign(const string& s) {
-    callsign = s;
-}
-
-
 void FGAIAircraft::doGroundAltitude() {
     if (fabs(altitude_ft - (tgt_altitude_ft+groundOffset)) > 1000.0)
         altitude_ft = (tgt_altitude_ft + groundOffset);
@@ -705,7 +691,7 @@ void FGAIAircraft::controlHeading(FGAIFlightPlan::waypoint* curr) {
 
     if (finite(calc_bearing)) {
         double hdg_error = calc_bearing - tgt_heading;
-        if (fabs(hdg_error) > 1.0) {
+        if (fabs(hdg_error) > 0.01) {
             TurnTo( calc_bearing );
         }
 
@@ -732,7 +718,9 @@ void FGAIAircraft::controlSpeed(FGAIFlightPlan::waypoint* curr, FGAIFlightPlan::
 
     if (fabs(speed_diff) > 10) {
         prevSpeed = speed;
-        fp->setLeadDistance(speed, tgt_heading, curr, next);
+        if (next) {
+            fp->setLeadDistance(speed, tgt_heading, curr, next);
+        }
     }
 }