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).
This commit is contained in:
SaW
2025-03-03 15:10:47 +01:00
committed by GitHub
parent fe21dfe48e
commit 13a4dde643

View File

@@ -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());
}