mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 08:17:56 +00:00
fix(Core/Movement): Improved pet's follow movement. (#11585)
Fixes #9254
This commit is contained in:
@@ -453,11 +453,10 @@ bool FollowMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
|||||||
else
|
else
|
||||||
i_path->Clear();
|
i_path->Clear();
|
||||||
|
|
||||||
float distance = _range - target->GetCombatReach();
|
target->MovePositionToFirstCollision(targetPosition, owner->GetCombatReach() + _range, target->ToAbsoluteAngle(_angle.RelativeAngle) - target->GetOrientation());
|
||||||
|
|
||||||
float relAngle = _angle.RelativeAngle;
|
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
target->GetNearPoint(owner, x, y, z, owner->GetCombatReach(), distance, target->ToAbsoluteAngle(relAngle), 0.f, &targetPosition);
|
targetPosition.GetPosition(x, y, z);
|
||||||
|
|
||||||
if (owner->IsHovering())
|
if (owner->IsHovering())
|
||||||
owner->UpdateAllowedPositionZ(x, y, z);
|
owner->UpdateAllowedPositionZ(x, y, z);
|
||||||
|
|||||||
Reference in New Issue
Block a user