Fix look at target privacy causing head to get stuck

master
Kyler Eastridge 2025-07-28 04:33:34 +01:00 committed by Andrey Kleshchev
parent 5c8fdad01f
commit 5785bfdb70
2 changed files with 20 additions and 6 deletions

View File

@ -393,14 +393,22 @@ void LLHUDEffectLookAt::setTargetPosGlobal(const LLVector3d &target_pos_global)
//-----------------------------------------------------------------------------
bool LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVector3 position)
{
static LLCachedControl<bool> enable_lookat_hints(gSavedSettings, "EnableLookAtHints", true);
if (!enable_lookat_hints)
if (!mSourceObject)
{
return false;
}
if (!mSourceObject)
static LLCachedControl<bool> 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;
}

View File

@ -222,14 +222,20 @@ void LLHUDEffectPointAt::setTargetPosGlobal(const LLVector3d &target_pos_global)
//-----------------------------------------------------------------------------
bool LLHUDEffectPointAt::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position)
{
static LLCachedControl<bool> enable_selection_hints(gSavedSettings, "EnableSelectionHints", true);
if (!enable_selection_hints)
if (!mSourceObject)
{
return false;
}
if (!mSourceObject)
static LLCachedControl<bool> enable_selection_hints(gSavedSettings, "EnableSelectionHints", true);
if (!enable_selection_hints)
{
if (mTargetType != POINTAT_TARGET_NONE)
{
clearPointAtTarget();
setDuration(1.f);
setNeedsSendToSim(true);
}
return false;
}