fix(Core/Movement): Improved player's pet follow movement. (#8217)
Fixes #8127
This commit is contained in:
@@ -2668,9 +2668,18 @@ void WorldObject::GetNearPoint(WorldObject const* searcher, float& x, float& y,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// still not in LoS, give up and return first position found
|
// still not in LoS, give up and return first position found
|
||||||
x = first_x;
|
if (startPos)
|
||||||
y = first_y;
|
{
|
||||||
z = first_z;
|
x = searcher->GetPositionX();
|
||||||
|
y = searcher->GetPositionY();
|
||||||
|
z = searcher->GetPositionZ();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = first_x;
|
||||||
|
y = first_y;
|
||||||
|
z = first_z;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldObject::GetVoidClosePoint(float& x, float& y, float& z, float size, float distance2d /*= 0*/, float relAngle /*= 0*/, float controlZ /*= 0*/) const
|
void WorldObject::GetVoidClosePoint(float& x, float& y, float& z, float size, float distance2d /*= 0*/, float relAngle /*= 0*/, float controlZ /*= 0*/) const
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ bool FollowMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
|||||||
owner->UpdateAllowedPositionZ(x, y, z);
|
owner->UpdateAllowedPositionZ(x, y, z);
|
||||||
|
|
||||||
bool success = i_path->CalculatePath(x, y, z, forceDest);
|
bool success = i_path->CalculatePath(x, y, z, forceDest);
|
||||||
if (!success || i_path->GetPathType() & PATHFIND_NOPATH)
|
if (!success || (i_path->GetPathType() & PATHFIND_NOPATH && !followingMaster))
|
||||||
{
|
{
|
||||||
if (!owner->IsStopped())
|
if (!owner->IsStopped())
|
||||||
owner->StopMoving();
|
owner->StopMoving();
|
||||||
|
|||||||
Reference in New Issue
Block a user