fix calculate AWD conditionless

This commit is contained in:
Ulrich Meine
2026-05-22 23:10:51 +02:00
parent 1425297ef4
commit a218da8948
+4 -4
View File
@@ -467,10 +467,6 @@ bool WindUtils::handleWinds(bool calcWinds)
double twd, tws, twa, awd; double twd, tws, twa, awd;
bool twCalculated = false; bool twCalculated = false;
if (!calcWinds) { // don't calculate anything if true wind calculation has not been set in configuration
return twCalculated;
}
double awaVal = awaBVal->valid ? awaBVal->value : DBL_MAX; double awaVal = awaBVal->valid ? awaBVal->value : DBL_MAX;
double awsVal = awsBVal->valid ? awsBVal->value : DBL_MAX; double awsVal = awsBVal->valid ? awsBVal->value : DBL_MAX;
double cogVal = cogBVal->valid ? cogBVal->value : DBL_MAX; double cogVal = cogBVal->valid ? cogBVal->value : DBL_MAX;
@@ -504,6 +500,10 @@ bool WindUtils::handleWinds(bool calcWinds)
} }
} }
if (!calcWinds) { // don't calculate true winds if not set in configuration
return twCalculated;
}
// calculate TWD if not existing and if possible // calculate TWD if not existing and if possible
if (!twdBVal->valid) { if (!twdBVal->valid) {
// calculate TWD if it does not exist yet and TWA is available // calculate TWD if it does not exist yet and TWA is available