Core/Object: Fix Line of Sight issue with object edges

Fixes: https://github.com/TrinityCore/TrinityCore/pull/15807#issuecomment-268077802
This commit is contained in:
Golrag authored and Aokromes committed 2017-03-20 16:53:30 +01:00
1 parent d64db19d82
commit e4b11f277b
1 file changed
+1 -1
+1 -1
View File
@@ -1463,7 +1463,7 @@ Position WorldObject::GetHitSpherePointFor(Position const& dest) const
{
G3D::Vector3 vThis(GetPositionX(), GetPositionY(), GetPositionZ());
G3D::Vector3 vObj(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ());
G3D::Vector3 contactPoint = vThis + (vObj - vThis).directionOrZero() * GetObjectSize();
G3D::Vector3 contactPoint = vThis + (vObj - vThis).directionOrZero() * std::min(dest.GetExactDist(GetPosition()), GetObjectSize());
return Position(contactPoint.x, contactPoint.y, contactPoint.z, GetAngle(contactPoint.x, contactPoint.y));
}