From bbea07e8b19b22b0a4120f40be1f0a7c4133ef67 Mon Sep 17 00:00:00 2001 From: Vivian Meazza Date: Fri, 12 Oct 2012 21:59:06 +0100 Subject: [PATCH] Bugfix: correct calculation of range and realtive bearing when parent is not the main model. Signed-off-by: Vivian Meazza --- src/AIModel/AIWingman.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AIModel/AIWingman.cxx b/src/AIModel/AIWingman.cxx index 42c27641c..218f9e73a 100644 --- a/src/AIModel/AIWingman.cxx +++ b/src/AIModel/AIWingman.cxx @@ -243,6 +243,7 @@ void FGAIWingman::formateToAC(double dt){ double p_hdg, p_pch, p_rll, p_agl, p_ht, p_wow = 0; setTgtOffsets(dt, 25); + _setUserPos(); if (_pnode != 0) { setParentPos(); @@ -253,7 +254,6 @@ void FGAIWingman::formateToAC(double dt){ setOffsetPos(_parentpos, p_hdg, p_pch, p_rll); setSpeed(_p_spd_node->getDoubleValue()); }else { - _setUserPos(); p_hdg = manager->get_user_heading(); p_pch = manager->get_user_pitch(); p_rll = manager->get_user_roll(); @@ -341,6 +341,7 @@ void FGAIWingman::Join(double dt) { double p_hdg, p_pch, p_rll = 0; setTgtOffsets(dt, 25); + _setUserPos(); if (_pnode != 0) { setParentPos(); @@ -351,7 +352,6 @@ void FGAIWingman::Join(double dt) { parent_hdg = _p_hdg_node->getDoubleValue(); parent_spd = _p_spd_node->getDoubleValue(); }else { - _setUserPos(); p_hdg = manager->get_user_heading(); p_pch = manager->get_user_pitch(); p_rll = manager->get_user_roll();