From 5785bfdb700c618365ea22c4deb3e6330d31c3d2 Mon Sep 17 00:00:00 2001 From: Kyler Eastridge Date: Mon, 28 Jul 2025 04:33:34 +0100 Subject: Fix look at target privacy causing head to get stuck --- indra/newview/llhudeffectlookat.cpp | 14 +++++++++++--- indra/newview/llhudeffectpointat.cpp | 12 +++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index a8fde33a25..e7894e6c84 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -393,14 +393,22 @@ void LLHUDEffectLookAt::setTargetPosGlobal(const LLVector3d &target_pos_global) //----------------------------------------------------------------------------- bool LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVector3 position) { - static LLCachedControl enable_lookat_hints(gSavedSettings, "EnableLookAtHints", true); - if (!enable_lookat_hints) + if (!mSourceObject) { return false; } - if (!mSourceObject) + static LLCachedControl enable_lookat_hints(gSavedSettings, "EnableLookAtHints", true); + if (!enable_lookat_hints) { + if (mTargetType != LOOKAT_TARGET_IDLE) + { + mTargetObject = gAgentAvatarp; + mTargetType = LOOKAT_TARGET_IDLE; + mTargetOffsetGlobal.set(2.f, 0.f, 0.f); + setDuration(3.f); + setNeedsSendToSim(true); + } return false; } diff --git a/indra/newview/llhudeffectpointat.cpp b/indra/newview/llhudeffectpointat.cpp index 23ab0e873d..b6515df3e1 100644 --- a/indra/newview/llhudeffectpointat.cpp +++ b/indra/newview/llhudeffectpointat.cpp @@ -222,14 +222,20 @@ void LLHUDEffectPointAt::setTargetPosGlobal(const LLVector3d &target_pos_global) //----------------------------------------------------------------------------- bool LLHUDEffectPointAt::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position) { - static LLCachedControl enable_selection_hints(gSavedSettings, "EnableSelectionHints", true); - if (!enable_selection_hints) + if (!mSourceObject) { return false; } - if (!mSourceObject) + static LLCachedControl enable_selection_hints(gSavedSettings, "EnableSelectionHints", true); + if (!enable_selection_hints) { + if (mTargetType != POINTAT_TARGET_NONE) + { + clearPointAtTarget(); + setDuration(1.f); + setNeedsSendToSim(true); + } return false; } -- cgit v1.2.3