]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIBallistic.cxx
ITM radio calculations are only considered valid
[flightgear.git] / src / AIModel / AIBallistic.cxx
index 3fc3e8022660d7746d1d5d06ae3e405301882865..68d72f92baf281ad6dd1caf1294cde7220e81cb0 100644 (file)
@@ -126,7 +126,11 @@ void FGAIBallistic::readFromScenario(SGPropertyNode* scFileNode) {
 
 bool FGAIBallistic::init(bool search_in_AI_path) {
     FGAIBase::init(search_in_AI_path);
+    reinit();
+    return true;
+}
 
+void FGAIBallistic::reinit() {
     _impact_reported = false;
     _collision_reported = false;
     _expiry_reported = false;
@@ -179,7 +183,7 @@ bool FGAIBallistic::init(bool search_in_AI_path) {
 
     setParentNodes(_selected_ac);
 
-    return true;
+    FGAIBase::reinit();
 }
 
 void FGAIBallistic::bind() {
@@ -635,21 +639,21 @@ void FGAIBallistic::slaveToAC(double dt){
     if (invisible)
         return;
 
-    double hdg, pch, rll, agl = 0;
+    double hdg, pch, rll;//, agl = 0;
 
     if (_pnode != 0) {
         setParentPos();
         hdg = _p_hdg_node->getDoubleValue();
         pch = _p_pch_node->getDoubleValue();
         rll = _p_rll_node->getDoubleValue();
-        agl = _p_agl_node->getDoubleValue();
+//        agl = _p_agl_node->getDoubleValue();
         setOffsetPos(_parentpos, hdg, pch, rll);
         setSpeed(_p_spd_node->getDoubleValue());
     }else {
         hdg = manager->get_user_heading();
         pch = manager->get_user_pitch();
         rll = manager->get_user_roll();
-        agl = manager->get_user_agl();
+//        agl = manager->get_user_agl();
         setOffsetPos(userpos, hdg, pch, rll);
         setSpeed(manager->get_user_speed());
     }