]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIShip.cxx
cosmetic changes *only*:
[flightgear.git] / src / AIModel / AIShip.cxx
index 30e889aba6b3119e3889813134217ad4d8b722e3..f7f0852ed340ee38590435c4e67d5024ba425f6b 100644 (file)
@@ -174,9 +174,10 @@ void FGAIShip::unbind() {
     props->untie("position/waypoint-range-rate-nm-sec");
     props->untie("position/waypoint-new");
     props->untie("position/waypoint-missed");
+    props->untie("position/waypoint-missed-count");
+    props->untie("position/waypoint-missed-time-sec");
     props->untie("position/waypoint-wait-count");
     props->untie("position/waypoint-waiting");
-    props->untie("position/waypoint-missed-time-sec");
     props->untie("submodels/serviceable");
 }
 
@@ -283,6 +284,7 @@ void FGAIShip::Run(double dt) {
     roll = (raw_roll * _roll_constant) + (roll * (1 - _roll_constant));
 
     // adjust target _rudder angle if heading lock engaged
+    double rudder_diff = 0.0;
     if (_hdg_lock) {
         double rudder_sense = 0.0;
         double diff = fabs(hdg - tgt_heading);
@@ -307,10 +309,9 @@ void FGAIShip::Run(double dt) {
             _tgt_rudder = diff * rudder_sense;
         else
             _tgt_rudder = 45 * rudder_sense;
-    }
 
-    // adjust _rudder angle
-    double rudder_diff = _tgt_rudder - _rudder;
+        rudder_diff = _tgt_rudder - _rudder;
+    }
 
     // set the _rudder limit by speed
     if (speed <= 40)
@@ -334,6 +335,8 @@ void FGAIShip::Run(double dt) {
 
         }
 
+        // do calculations for radar
+        UpdateRadar(manager);
     }
 }//end function