From: onox Date: Thu, 28 May 2015 21:46:18 +0000 (+0200) Subject: submodel: Only warn if an <*-offset> is actually present X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=56a014cdc7acca925931869fa6961b96692c5e14;p=flightgear.git submodel: Only warn if an <*-offset> is actually present Signed-off-by: onox --- diff --git a/src/AIModel/submodel.cxx b/src/AIModel/submodel.cxx index 206792a12..cb4dc592c 100644 --- a/src/AIModel/submodel.cxx +++ b/src/AIModel/submodel.cxx @@ -554,22 +554,30 @@ void FGSubmodelMgr::setData(int id, const string& path, bool serviceable, const sm->pitch_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n); } else { - SG_LOG(SG_AI, SG_WARN, "Submodels: <*-offset> is deprecated. Use instead"); + bool old = false; b = entry_node->getNode("x-offset"); sm->x_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n); + if (b) old = true; b = entry_node->getNode("y-offset"); sm->y_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n); + if (b) old = true; b = entry_node->getNode("z-offset"); sm->z_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n); + if (b) old = true; b = entry_node->getNode("yaw-offset"); sm->yaw_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n); + if (b) old = true; b = entry_node->getNode("pitch-offset"); sm->pitch_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n); + if (b) old = true; + + if (old) + SG_LOG(SG_AI, SG_WARN, "Submodels: <*-offset> is deprecated. Use instead"); } // Randomness