]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/submodel.cxx
Interim windows build fix
[flightgear.git] / src / AIModel / submodel.cxx
index 378e15f48ac26fe2782e9132681febdf4dc462ae..b3000f9a39ec6770a5e4776e7e724e6ff5b542bc 100644 (file)
@@ -533,12 +533,6 @@ void FGSubmodelMgr::setData(int id, const string& path, bool serviceable, const
         SGPropertyNode n;
         SGPropertyNode_ptr a, b;
 
-        a = entry_node->getNode("yaw-offset");
-        sm->yaw_offset   = new FGXMLAutopilot::InputValue(*prop_root, a ? *a : n);
-
-        a = entry_node->getNode("pitch-offset");
-        sm->pitch_offset = new FGXMLAutopilot::InputValue(*prop_root, a ? *a : n);
-
         // Offsets
         a = entry_node->getNode("offsets", false);
         sm->offsets_in_meter = (a != 0);
@@ -552,16 +546,41 @@ void FGSubmodelMgr::setData(int id, const string& path, bool serviceable, const
 
             b = a->getNode("z-m");
             sm->z_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n);
+
+            b = a->getNode("heading-deg");
+            sm->yaw_offset   = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n);
+
+            b = a->getNode("pitch-deg");
+            sm->pitch_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n);
         }
         else {
+            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 defined(ENABLE_DEV_WARNINGS)
+            if (old) {
+                SG_LOG(SG_AI, SG_WARN, "Submodels: <*-offset> is deprecated. Use <offsets> instead");
+            }
+#endif
         }
 
         // Randomness