From ceba006c6096076ea3b1efbf9446b5fdeaa291dc Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Wed, 1 Apr 2020 21:47:53 +0100 Subject: [PATCH] Only sync scenery-path-suffix with valid name It is possible to have a property tree with /sim/rendering/scenery-path-suffix[n]/enabled=true /sim/rendering/scenery-path-suffix[n]/name= Previously this would be downloaded as scenery//[tile] Now we just ignore such invalid paths. --- simgear/scene/tsync/terrasync.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simgear/scene/tsync/terrasync.cxx b/simgear/scene/tsync/terrasync.cxx index e0daf980..841d1fa5 100644 --- a/simgear/scene/tsync/terrasync.cxx +++ b/simgear/scene/tsync/terrasync.cxx @@ -1030,14 +1030,14 @@ string_list SGTerraSync::getSceneryPathSuffixes() const string_list scenerySuffixes; for (auto node : _renderingRoot->getChildren("scenery-path-suffix")) { - if (node->getBoolValue("enabled", true)) { + if (node->getBoolValue("enabled", true) && node->hasValue("name")) { scenerySuffixes.push_back(node->getStringValue("name")); } } if (scenerySuffixes.empty()) { // if preferences didn't load, use some default - scenerySuffixes = {"Objects", "Terrain"}; // defaut values + scenerySuffixes = {"Objects", "Terrain"}; // default values } return scenerySuffixes;