mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
fix(Core/Movement): Corrected calculating ground level in shallow water. (#5114)
This commit is contained in:
@@ -1516,10 +1516,11 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float& z, float* grou
|
||||
|
||||
if (max_z > INVALID_HEIGHT)
|
||||
{
|
||||
if (canSwim && unit->GetMap()->IsInWater(x, y, max_z - Z_OFFSET_FIND_HEIGHT)) {
|
||||
if (canSwim && unit->GetMap()->IsInWater(x, y, max_z - Z_OFFSET_FIND_HEIGHT))
|
||||
{
|
||||
// do not allow creatures to walk on
|
||||
// water level while swimming
|
||||
max_z = max_z - GetMinHeightInWater();
|
||||
max_z = std::max(max_z - GetMinHeightInWater(), ground_z);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user