fix(Core/Movement): Water-bound creatures should not evade if their t… (#12112)

fix(Core/Movement): Water-bound creatures should not evade if their target is near the surface/jumping in the water.

Fixed #10383
This commit is contained in:
UltraNix
2022-06-20 20:31:28 +02:00
committed by GitHub
parent 95787beb57
commit 61c64bbf30

View File

@@ -3870,7 +3870,11 @@ bool Unit::isInAccessiblePlaceFor(Creature const* c) const
return false;
}
if (IsInWater())
LiquidStatus liquidStatus = GetLiquidData().Status;
bool isInWater = (liquidStatus & MAP_LIQUID_STATUS_SWIMMING) != 0;
// In water or jumping in water
if (isInWater || (liquidStatus == LIQUID_MAP_ABOVE_WATER && (IsFalling() || (ToPlayer() && ToPlayer()->IsFalling()))))
{
return c->CanEnterWater();
}