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=<blank> Previously this would be downloaded as scenery//[tile] Now we just ignore such invalid paths.
This commit is contained in:
@@ -1030,14 +1030,14 @@ string_list SGTerraSync::getSceneryPathSuffixes() const
|
|||||||
string_list scenerySuffixes;
|
string_list scenerySuffixes;
|
||||||
|
|
||||||
for (auto node : _renderingRoot->getChildren("scenery-path-suffix")) {
|
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"));
|
scenerySuffixes.push_back(node->getStringValue("name"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scenerySuffixes.empty()) {
|
if (scenerySuffixes.empty()) {
|
||||||
// if preferences didn't load, use some default
|
// if preferences didn't load, use some default
|
||||||
scenerySuffixes = {"Objects", "Terrain"}; // defaut values
|
scenerySuffixes = {"Objects", "Terrain"}; // default values
|
||||||
}
|
}
|
||||||
|
|
||||||
return scenerySuffixes;
|
return scenerySuffixes;
|
||||||
|
|||||||
Reference in New Issue
Block a user