bool FGAIWingman::init(bool search_in_AI_path) {
if (!FGAIBallistic::init(search_in_AI_path))
return false;
+ reinit();
+ return true;
+}
+void FGAIWingman::reinit() {
invisible = false;
_tgt_x_offset = _x_offset;
props->setStringValue("submodels/path", _path.c_str());
user_WoW_node = fgGetNode("gear/gear[1]/wow", true);
- return true;
+
+ FGAIBallistic::reinit();
}
void FGAIWingman::update(double dt) {
_formate_to_ac = true;
_join = false;
- SG_LOG(SG_GENERAL, SG_ALERT, _name << " joined " << " RANGE " << distance
+ SG_LOG(SG_AI, SG_ALERT, _name << " joined " << " RANGE " << distance
<< " SPEED " << speed );
return;
//double approx_angle = atan2(daltM, range);
double frm_spd = 50; // formation speed
double join_rnge = 1000.0;
- double recip_parent_hdg = calcRecipBearingDeg(parent_hdg);
+// double recip_parent_hdg = calcRecipBearingDeg(parent_hdg);
int turn = SGMiscd::sign(rel_brg);// turn direction: 1 = right, -1 = left
if (range <= join_rnge && (hdg >= hdg_l_lim || hdg <= hdg_r_lim)){