From a218da894846f5d92074941da43c783f8f92cd7f Mon Sep 17 00:00:00 2001 From: Ulrich Meine Date: Fri, 22 May 2026 23:10:51 +0200 Subject: [PATCH] fix calculate AWD conditionless --- lib/obp60task/OBPDataOperations.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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