fix(Core/Movement): Make sure pet always follows its master. (#5103)
This commit is contained in:
parent
d069d19df0
commit
7d69ee8b9c
1 changed files with 6 additions and 5 deletions
|
|
@ -151,12 +151,13 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
|||
if (owner->IsHovering())
|
||||
owner->UpdateAllowedPositionZ(x, y, z);
|
||||
|
||||
i_recalculateTravel = true;
|
||||
|
||||
bool success = i_path->CalculatePath(x, y, z, forceDest);
|
||||
if (!success || i_path->GetPathType() & PATHFIND_NOPATH)
|
||||
{
|
||||
if (cOwner)
|
||||
cOwner->SetCannotReachTarget(true);
|
||||
owner->StopMoving();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -173,7 +174,6 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
|||
}
|
||||
|
||||
owner->AddUnitState(UNIT_STATE_CHASE_MOVE);
|
||||
i_recalculateTravel = true;
|
||||
|
||||
Movement::MoveSplineInit init(owner);
|
||||
init.MovebyPath(i_path->GetPath());
|
||||
|
|
@ -333,17 +333,18 @@ bool FollowMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
|||
|
||||
target->GetNearPoint(owner, x, y, z, _range, 0.f, target->ToAbsoluteAngle(tAngle));
|
||||
|
||||
i_recalculateTravel = true;
|
||||
|
||||
bool success = i_path->CalculatePath(x, y, z, forceDest);
|
||||
if (!success || i_path->GetPathType() & PATHFIND_NOPATH)
|
||||
{
|
||||
owner->StopMoving();
|
||||
if (cOwner)
|
||||
cOwner->SetCannotReachTarget(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
owner->AddUnitState(UNIT_STATE_FOLLOW_MOVE);
|
||||
|
||||
i_recalculateTravel = true;
|
||||
|
||||
Movement::MoveSplineInit init(owner);
|
||||
init.MovebyPath(i_path->GetPath());
|
||||
init.SetFacing(target->GetOrientation());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue