diff --git a/lib/obp60task/OBPDataOperations.cpp b/lib/obp60task/OBPDataOperations.cpp index 171e507..1ed7662 100644 --- a/lib/obp60task/OBPDataOperations.cpp +++ b/lib/obp60task/OBPDataOperations.cpp @@ -467,10 +467,6 @@ bool WindUtils::handleWinds(bool calcWinds) double twd, tws, twa, awd; 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 awsVal = awsBVal->valid ? awsBVal->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 if (!twdBVal->valid) { // calculate TWD if it does not exist yet and TWA is available