]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIEscort.cxx
ITM radio calculations are only considered valid
[flightgear.git] / src / AIModel / AIEscort.cxx
index 2b758e6abb7e3c1ec19fda419f7f78f253164469..c88e9af334adf5afac1530819877a71a8c438e56 100644 (file)
@@ -35,7 +35,6 @@
 #include <Main/viewer.hxx>
 
 #include <Scenery/scenery.hxx>
-#include <Scenery/tilemgr.hxx>
 
 #include "AIEscort.hxx"
 
@@ -135,7 +134,11 @@ void FGAIEscort::unbind() {
 bool FGAIEscort::init(bool search_in_AI_path) {
     if (!FGAIShip::init(search_in_AI_path))
         return false;
+    reinit();
+    return true;
+}
 
+void FGAIEscort::reinit() {
     invisible = false;
     no_roll = false;
 
@@ -148,7 +151,7 @@ bool FGAIEscort::init(bool search_in_AI_path) {
         hdg = _parent_hdg;
     }
 
-    return true;
+    FGAIShip::reinit();
 }
 
 void FGAIEscort::update(double dt) {
@@ -230,7 +233,6 @@ bool FGAIEscort::getGroundElev(SGGeod inpos) {
 
 }
 
-
 void FGAIEscort::setParent()
 {
     double lat = _selected_ac->getDoubleValue("position/latitude-deg");
@@ -278,13 +280,6 @@ void FGAIEscort::calcRangeBearing(double lat, double lon, double lat2, double lo
     range = distance * SG_METER_TO_NM;
 }
 
-double FGAIEscort::calcRelBearingDeg(double bearing, double heading)
-{
-    double angle = bearing - heading;
-    SG_NORMALIZE_RANGE(angle, -180.0, 180.0);
-    return angle;
-}
-
 double FGAIEscort::calcTrueBearingDeg(double bearing, double heading)
 {
     double angle = bearing + heading;
@@ -292,13 +287,6 @@ double FGAIEscort::calcTrueBearingDeg(double bearing, double heading)
     return angle;
 }
 
-double FGAIEscort::calcRecipBearingDeg(double bearing)
-{
-    double angle = bearing - 180;
-    SG_NORMALIZE_RANGE(angle, 0.0, 360.0);
-    return angle;
-}
-
 SGVec3d FGAIEscort::getCartHitchPosAt(const SGVec3d& _off) const {
     double hdg = _selected_ac->getDoubleValue("orientation/true-heading-deg");
     double pitch = _selected_ac->getDoubleValue("orientation/pitch-deg");
@@ -330,7 +318,7 @@ void FGAIEscort::setStationSpeed(){
     // these are the AI rules for the manoeuvring of escorts
 
     if (_MPControl && _tgtrange > 4 * _stn_limit){
-        SG_LOG(SG_GENERAL, SG_ALERT, "AIEscort: " << _name
+        SG_LOG(SG_AI, SG_ALERT, "AIEscort: " << _name
             << " re-aligning to MP pos");
         pos = _tgtpos;
         speed = 0;