From 5f0b23edd7b43db2a8ece563b4b3d110d70282a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Fri, 17 Jan 2020 02:25:45 -0500 Subject: [PATCH] [Follow] Try to sit on far away objects by moving closer Groundsit if that still fails --- indra/newview/llagent.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index f71751087..9912ff081 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1785,13 +1785,18 @@ void LLAgent::autoPilot(F32 *delta_yaw) { if (auto seat = av->getParent()) { - mAutoPilotNoProgressFrameCount = 0; // Ground Sit may have incremented this, reset it - if (gAgentAvatarp->getParent() != seat) + if (gAgentAvatarp->getParent() == seat) + { + mAutoPilotNoProgressFrameCount = 0; // We may have incremented this before making it here, reset it + return; // We're seated with them, nothing more to do + } + else if (!getAutoPilotNoProgress()) { void handle_object_sit(LLViewerObject*, const LLVector3&); handle_object_sit(static_cast(seat), LLVector3::zero); + follow = 2; // Indicate ground sitting is okay if we can't make it } - return; // If sitting, we won't be moving, exit here + else return; // If the server just wouldn't let us sit there, we won't be moving, exit here } else // Ground sit, but only if near enough {