Core/Movement: MoveSmoothPath will now automatically flag a ground path as uncompressed when the delta is > 400

This commit is contained in:
Ovahlord
2020-01-27 21:30:20 +01:00
parent 92852a437a
commit 6be00413a9

View File

@@ -530,8 +530,24 @@ void MotionMaster::MoveSmoothPath(uint32 pointId, Position const* pathPoints, si
if (fly)
{
init.SetFly();
init.SetUncompressed();
init.SetSmooth();
init.SetUncompressed();
}
else
{
if (pathSize > 1)
{
G3D::Vector3 middle = (path[0] + path[pathSize]) / 2.f;
for (uint32 i = 1; i < pathSize; ++i)
{
G3D::Vector3 delta = middle - path[i];
if (delta.x > 400 || delta.y > 400 || delta.z > 400)
{
init.SetUncompressed();
break;
}
}
}
}
if (velocity > 0.0f)