1
0
Fork 0

submodel: Only warn if an <*-offset> is actually present

Signed-off-by: onox <denkpadje@gmail.com>
This commit is contained in:
onox 2015-05-28 23:46:18 +02:00 committed by Erik Hofman
parent 8024a0a4ca
commit 56a014cdc7

View 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); sm->pitch_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n);
} }
else { else {
SG_LOG(SG_AI, SG_WARN, "Submodels: <*-offset> is deprecated. Use <offsets> instead"); bool old = false;
b = entry_node->getNode("x-offset"); b = entry_node->getNode("x-offset");
sm->x_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n); sm->x_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n);
if (b) old = true;
b = entry_node->getNode("y-offset"); b = entry_node->getNode("y-offset");
sm->y_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n); sm->y_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n);
if (b) old = true;
b = entry_node->getNode("z-offset"); b = entry_node->getNode("z-offset");
sm->z_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n); sm->z_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n);
if (b) old = true;
b = entry_node->getNode("yaw-offset"); b = entry_node->getNode("yaw-offset");
sm->yaw_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n); sm->yaw_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n);
if (b) old = true;
b = entry_node->getNode("pitch-offset"); b = entry_node->getNode("pitch-offset");
sm->pitch_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n); 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 // Randomness