fix(Core/Movement): Teleport pet when pathfinding returns PATHFIND_NOT_USING_PATH (#23494)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
Co-authored-by: Ryan Turner <16946913+TheSCREWEDSoftware@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-03-08 12:33:32 -05:00
committed by GitHub
parent 73f8af325d
commit 6d9b89c976
2 changed files with 18 additions and 1 deletions
@@ -648,8 +648,16 @@ bool FollowMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
owner->UpdateAllowedPositionZ(x, y, z);
bool success = i_path->CalculatePath(x, y, z, forceDest);
if (!success || (i_path->GetPathType() & PATHFIND_NOPATH && !followingMaster))
bool cannotReachTarget = !success || (i_path->GetPathType() & PATHFIND_NOPATH && !followingMaster);
if (oPet && followingMaster && !owner->CanFly() && (i_path->GetPathType() & PATHFIND_NOT_USING_PATH))
cannotReachTarget = true;
if (cannotReachTarget)
{
if (oPet && followingMaster)
cOwner->SetCannotReachTarget(target->GetGUID());
if (!owner->IsStopped())
owner->StopMoving();