From 56a014cdc7acca925931869fa6961b96692c5e14 Mon Sep 17 00:00:00 2001 From: onox Date: Thu, 28 May 2015 23:46:18 +0200 Subject: [PATCH] submodel: Only warn if an <*-offset> is actually present Signed-off-by: onox --- src/AIModel/submodel.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.39.5