diff options
| author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2021-02-21 17:29:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-21 17:29:09 +0100 |
| commit | f96aab2186d17ddd286fa42913f3f14e9562c4eb (patch) | |
| tree | e06d165e7d1101c4521ffbda346efd1b147b9aee /src/server/game/Entities/Object | |
| parent | 69916138bdb61444c53acb059987e7b058bc175e (diff) | |
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)
Diffstat (limited to 'src/server/game/Entities/Object')
| -rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 1ed1b859855..87a5a693e5f 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -3554,7 +3554,7 @@ 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)); } float WorldObject::GetMapWaterOrGroundLevel(float x, float y, float z, float* ground/* = nullptr*/) const @@ -3567,7 +3567,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(GetPhaseMask(), x, y, z, vmap, distanceToSearch); } |
