1
0
Fork 0

Error reporting: check custom scenery before FGData

Some people put custom scenery inside FGData, re-order to catch
that case.
This commit is contained in:
James Turner 2021-07-31 17:21:51 +01:00
parent 0a6c4aaf7a
commit a156c5a14d

View file

@ -434,11 +434,6 @@ auto ErrorReporter::ErrorReporterPrivate::getAggregateForOccurence(const ErrorRe
// incorrectly, we attribute the error to the scenery, which is
// likely what we want/expect
auto path = oc.hasContextKey("terrain-stg") ? oc.getContextValue("terrain-stg") : oc.getContextValue("btg");
if (simgear::strutils::starts_with(path, _fgdataPathPrefix)) {
return getAggregate(Aggregation::FGData, {});
} else if (simgear::strutils::starts_with(path, _terrasyncPathPrefix)) {
return getAggregate(Aggregation::TerraSync, {});
}
// custom scenery, find out the prefix
for (const auto& sceneryPath : globals->get_fg_scenery()) {
@ -448,6 +443,15 @@ auto ErrorReporter::ErrorReporterPrivate::getAggregateForOccurence(const ErrorRe
}
}
// try generic paths
if (simgear::strutils::starts_with(path, _fgdataPathPrefix)) {
return getAggregate(Aggregation::FGData, {});
} else if (simgear::strutils::starts_with(path, _terrasyncPathPrefix)) {
return getAggregate(Aggregation::TerraSync, {});
}
// shouldn't ever happen
return getAggregate(Aggregation::CustomScenery, {});
}