From 9bcff210f90d57689557b7b8cc20cd336b8ab035 Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Sun, 21 Feb 2021 17:29:09 +0100 Subject: Core/Maps: Use a fixed offset instead of full collision height when retrieving floor Z (#26092) Use a fixed offset 0.5f instead of full collision height when retrieving floor Z as a full collision height ended up on the floor above a few times. It makes more sense to cast the ray just a bit higher up than using a full collision height (which by default is 2.0f) (cherry picked from commit f96aab2186d17ddd286fa42913f3f14e9562c4eb) --- src/server/game/Entities/Object/Object.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/game/Entities/Object') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 995f1b7b29c..191b88464d8 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -3588,7 +3588,7 @@ float WorldObject::GetFloorZ() const { if (!IsInWorld()) return m_staticFloorZ; - return std::max(m_staticFloorZ, GetMap()->GetGameObjectFloor(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ() + GetCollisionHeight())); + return std::max(m_staticFloorZ, GetMap()->GetGameObjectFloor(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ() + Z_OFFSET_FIND_HEIGHT)); } float WorldObject::GetMapWaterOrGroundLevel(float x, float y, float z, float* ground/* = nullptr*/) const @@ -3601,7 +3601,7 @@ float WorldObject::GetMapWaterOrGroundLevel(float x, float y, float z, float* gr 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(GetPhaseShift(), x, y, z, vmap, distanceToSearch); } -- cgit v1.2.3