From 13a4dde64337683298038f1769d2d92214ea8e26 Mon Sep 17 00:00:00 2001 From: SaW Date: Mon, 3 Mar 2025 15:10:47 +0100 Subject: [PATCH] Avoids the possible incorrect swimming state when bots coming ashore (#1051) Improves the check for when in/under water, avoiding the possible incorrect swimming state when bots coming ashore (shortly swimming in air). --- src/strategy/values/IsMovingValue.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/strategy/values/IsMovingValue.cpp b/src/strategy/values/IsMovingValue.cpp index a8dbcf66..2a03043c 100644 --- a/src/strategy/values/IsMovingValue.cpp +++ b/src/strategy/values/IsMovingValue.cpp @@ -24,5 +24,7 @@ bool IsSwimmingValue::Calculate() if (!target) return false; - return target->IsUnderWater() || (target->GetLiquidData().Status == LIQUID_MAP_IN_WATER && target->CanSwim()); + int8 targetInLiquidState = target->GetLiquidData().Status; + + return targetInLiquidState == LIQUID_MAP_UNDER_WATER || (targetInLiquidState == LIQUID_MAP_IN_WATER && target->CanSwim()); }