From f7434711adf9927f84a2b586b8d2d793d71845bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Fri, 17 Jan 2020 02:26:40 -0500 Subject: [PATCH] [Follow] Reset No Progress count when target's position changes --- indra/newview/llagent.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 9912ff081..c24556315 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1775,6 +1775,7 @@ void LLAgent::autoPilot(F32 *delta_yaw) if (follow) { llassert(mLeaderID.notNull()); + const auto old_pos = mAutoPilotTargetGlobal; if (auto object = gObjectList.findObject(mLeaderID)) { mAutoPilotTargetGlobal = object->getPositionGlobal(); @@ -1850,6 +1851,8 @@ void LLAgent::autoPilot(F32 *delta_yaw) follow = 3; // We're close enough, indicate no walking } } + if (old_pos != mAutoPilotTargetGlobal) + mAutoPilotNoProgressFrameCount = 0; } if (follow % 2 == 0 && gAgentAvatarp->mInAir && mAutoPilotAllowFlying)