]> git.mxchange.org Git - flightgear.git/commitdiff
submodel: Only warn if an <*-offset> is actually present
authoronox <denkpadje@gmail.com>
Thu, 28 May 2015 21:46:18 +0000 (23:46 +0200)
committerErik Hofman <erik@ehofman.com>
Fri, 29 May 2015 12:28:04 +0000 (14:28 +0200)
Signed-off-by: onox <denkpadje@gmail.com>
src/AIModel/submodel.cxx

index 206792a126b912d9df01d1e0971d2524770c10da..cb4dc592c4cc38b9f33b9c0cddf8546935599f7b 100644 (file)
@@ -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 <offsets> 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 <offsets> instead");
         }
 
         // Randomness