From a156c5a14dce09cadf133ee304f35057942197a6 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sat, 31 Jul 2021 17:21:51 +0100 Subject: [PATCH] Error reporting: check custom scenery before FGData Some people put custom scenery inside FGData, re-order to catch that case. --- src/Main/ErrorReporter.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Main/ErrorReporter.cxx b/src/Main/ErrorReporter.cxx index f0c3db3c5..25a160d63 100644 --- a/src/Main/ErrorReporter.cxx +++ b/src/Main/ErrorReporter.cxx @@ -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, {}); }