]> git.mxchange.org Git - simgear.git/commitdiff
scenery: Use correct property root in xml loading.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Thu, 22 Mar 2012 07:38:16 +0000 (08:38 +0100)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Thu, 22 Mar 2012 07:38:16 +0000 (08:38 +0100)
Really query for the root node when loading xml files.
This should fix
 http://code.google.com/p/flightgear-bugs/issues/detail?id=714

simgear/scene/model/SGReaderWriterXML.cxx

index 17f23bc75877e553919db0a6bfb57caee24e3168..6dbb42fc785f4563221fb8ea1d76670fbcae1e83 100644 (file)
@@ -215,8 +215,11 @@ sgLoad3DModel_internal(const SGPath& path,
     SGPath texturepath(path);
     SGPath modelDir(modelpath.dir());
     
-    SGSharedPtr<SGPropertyNode> prop_root = options->getPropertyNode();
-    if (!prop_root.valid())
+    SGSharedPtr<SGPropertyNode> prop_root;
+    if (options->getPropertyNode().valid() &&
+        options->getPropertyNode()->getRootNode())
+        prop_root = options->getPropertyNode()->getRootNode();
+    else
         prop_root = new SGPropertyNode;
     osg::ref_ptr<SGModelData> data = options->getModelData();