Skip to content

Commit 5785bfd

Browse files
FelixWolfakleshchev
authored andcommitted
Fix look at target privacy causing head to get stuck
1 parent 5c8fdad commit 5785bfd

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

indra/newview/llhudeffectlookat.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,14 +393,22 @@ void LLHUDEffectLookAt::setTargetPosGlobal(const LLVector3d &target_pos_global)
393393
//-----------------------------------------------------------------------------
394394
bool LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVector3 position)
395395
{
396-
static LLCachedControl<bool> enable_lookat_hints(gSavedSettings, "EnableLookAtHints", true);
397-
if (!enable_lookat_hints)
396+
if (!mSourceObject)
398397
{
399398
return false;
400399
}
401400

402-
if (!mSourceObject)
401+
static LLCachedControl<bool> enable_lookat_hints(gSavedSettings, "EnableLookAtHints", true);
402+
if (!enable_lookat_hints)
403403
{
404+
if (mTargetType != LOOKAT_TARGET_IDLE)
405+
{
406+
mTargetObject = gAgentAvatarp;
407+
mTargetType = LOOKAT_TARGET_IDLE;
408+
mTargetOffsetGlobal.set(2.f, 0.f, 0.f);
409+
setDuration(3.f);
410+
setNeedsSendToSim(true);
411+
}
404412
return false;
405413
}
406414

indra/newview/llhudeffectpointat.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,20 @@ void LLHUDEffectPointAt::setTargetPosGlobal(const LLVector3d &target_pos_global)
222222
//-----------------------------------------------------------------------------
223223
bool LLHUDEffectPointAt::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position)
224224
{
225-
static LLCachedControl<bool> enable_selection_hints(gSavedSettings, "EnableSelectionHints", true);
226-
if (!enable_selection_hints)
225+
if (!mSourceObject)
227226
{
228227
return false;
229228
}
230229

231-
if (!mSourceObject)
230+
static LLCachedControl<bool> enable_selection_hints(gSavedSettings, "EnableSelectionHints", true);
231+
if (!enable_selection_hints)
232232
{
233+
if (mTargetType != POINTAT_TARGET_NONE)
234+
{
235+
clearPointAtTarget();
236+
setDuration(1.f);
237+
setNeedsSendToSim(true);
238+
}
233239
return false;
234240
}
235241

0 commit comments

Comments
 (0)