mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
feat(Core/Maps): Use a fixed offset instead of full collision height when retrieving floor Z. (#4909)
This commit is contained in:
@@ -1516,7 +1516,7 @@ 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 - WATER_HEIGHT_TOLERANCE)) {
|
||||
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();
|
||||
@@ -3058,7 +3058,7 @@ uint64 WorldObject::GetTransGUID() const
|
||||
float WorldObject::GetMapHeight(float x, float y, float z, bool vmap/* = true*/, float distanceToSearch/* = DEFAULT_HEIGHT_SEARCH*/) const
|
||||
{
|
||||
if (z != MAX_HEIGHT)
|
||||
z += GetCollisionHeight();
|
||||
z += Z_OFFSET_FIND_HEIGHT;
|
||||
|
||||
return GetMap()->GetHeight(GetPhaseMask(), x, y, z, vmap, distanceToSearch);
|
||||
}
|
||||
@@ -3075,5 +3075,5 @@ float WorldObject::GetFloorZ() const
|
||||
if (!IsInWorld())
|
||||
return m_staticFloorZ;
|
||||
|
||||
return std::max<float>(m_staticFloorZ, GetMap()->GetGameObjectFloor(GetPhaseMask(), GetPositionX(), GetPositionY(), GetPositionZ() + GetCollisionHeight()));
|
||||
return std::max<float>(m_staticFloorZ, GetMap()->GetGameObjectFloor(GetPhaseMask(), GetPositionX(), GetPositionY(), GetPositionZ() + Z_OFFSET_FIND_HEIGHT));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user