From: Torsten Dreyer Date: Wed, 15 Feb 2012 13:54:02 +0000 (+0100) Subject: Don't untie a property when loading from xml X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=441dc41715123efd643aa5ba3e177128647eda13;p=simgear.git Don't untie a property when loading from xml executing the fgcommand loadxml implicitely untied every previously tied property if a property type was given in the property element. That made it impossible to autosave aircraft data for tied properties. This patch should fix this. It adds an inconsitency, though: if a property with a given type is read in which has been tied to before and the property types do not match, the property type in the xml file will be ignored. --- diff --git a/simgear/props/props_io.cxx b/simgear/props/props_io.cxx index 0877390e..8fae12f8 100644 --- a/simgear/props/props_io.cxx +++ b/simgear/props/props_io.cxx @@ -262,7 +262,10 @@ PropsVisitor::startElement (const char * name, const XMLAttributes &atts) } const char *type = atts.getValue("type"); - if (type) + // if a type is given and the node is tied, + // don't clear the value because + // clearValue() unties the property + if (type && false == node->isTied() ) node->clearValue(); push_state(node, type, mode, omit); }