mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-12-01 21:12:50 +08:00
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:
@@ -24,5 +24,7 @@ bool IsSwimmingValue::Calculate()
|
|||||||
if (!target)
|
if (!target)
|
||||||
return false;
|
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());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user