diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llhudtext.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index c87e2fb658..05c8c236e9 100755 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -384,11 +384,21 @@ void LLHUDText::updateVisibility() mPositionAgent -= dir_from_camera * mSourceObject->getVObjRadius(); } - mLastDistance = (mPositionAgent - LLViewerCamera::getInstance()->getOrigin()).magVec(); + if (!mTextSegments.size()) + { + mVisible = FALSE; + return; + } + mLastDistance = (mPositionAgent - LLViewerCamera::getInstance()->getOrigin()).magVec(); F32 obj_dist = dist_vec(mSourceObject->getPositionEdit(), LLViewerCamera::getInstance()->getOrigin()); - if (!mTextSegments.size() || (mDoFade && (mLastDistance > mFadeDistance + mFadeRange)) || (obj_dist > MAX_DRAW_DISTANCE)) + if(mSourceObject->isAttachment()) + { + LLViewerObject* parent = (LLViewerObject*)mSourceObject->getRoot(); + obj_dist = dist_vec(parent->getPositionEdit(), LLViewerCamera::getInstance()->getOrigin()); + } + if ((mDoFade && (mLastDistance > mFadeDistance + mFadeRange)) || (obj_dist > MAX_DRAW_DISTANCE)) { mVisible = FALSE; return; |