diff options
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 69f9a7e6fa..26d1ec1d6c 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1475,7 +1475,7 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid) object->sendTEUpdate(); // 1 particle effect per object LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); - effectp->setSourceObject(gAgent.getAvatarObject()); + effectp->setSourceObject(gAgentAvatar); effectp->setTargetObject(object); effectp->setDuration(LL_HUD_DUR_SHORT); effectp->setColor(LLColor4U(gAgent.getEffectColor())); @@ -3619,7 +3619,7 @@ void LLSelectMgr::sendAttach(U8 attachment_point) { LLViewerObject* attach_object = mSelectedObjects->getFirstRootObject(); - if (!attach_object || !gAgent.getAvatarObject() || mSelectedObjects->mSelectType != SELECT_TYPE_WORLD) + if (!attach_object || !isAgentAvatarValid() || mSelectedObjects->mSelectType != SELECT_TYPE_WORLD) { return; } @@ -3630,7 +3630,7 @@ void LLSelectMgr::sendAttach(U8 attachment_point) BOOL build_mode = LLToolMgr::getInstance()->inEdit(); // Special case: Attach to default location for this object. if (0 == attachment_point || - get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, (S32)attachment_point, (LLViewerJointAttachment*)NULL)) + get_if_there(gAgentAvatar->mAttachmentPoints, (S32)attachment_point, (LLViewerJointAttachment*)NULL)) { sendListToRegions( "ObjectAttach", @@ -4911,10 +4911,9 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) LLGLEnable blend(GL_BLEND); LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); - LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); - if (avatarp && for_hud) + if (isAgentAvatarValid() && for_hud) { - LLBBox hud_bbox = avatarp->getHUDBBox(); + LLBBox hud_bbox = gAgentAvatar->getHUDBBox(); F32 cur_zoom = gAgentCamera.mHUDCurZoom; @@ -5023,7 +5022,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) } } - if (avatarp && for_hud) + if (isAgentAvatarValid() && for_hud) { glMatrixMode(GL_PROJECTION); gGL.popMatrix(); @@ -5399,8 +5398,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) if (volume) { F32 silhouette_thickness; - LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); - if (avatarp && is_hud_object) + if (isAgentAvatarValid() && is_hud_object) { silhouette_thickness = LLSelectMgr::sHighlightThickness / gAgentCamera.mHUDCurZoom; } @@ -5610,16 +5608,16 @@ void LLSelectMgr::updateSelectionCenter() { mSelectedObjects->mSelectType = getSelectTypeForObject(object); - if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT && gAgent.getAvatarObject()) + if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT && isAgentAvatarValid()) { - mPauseRequest = gAgent.getAvatarObject()->requestPause(); + mPauseRequest = gAgentAvatar->requestPause(); } else { mPauseRequest = NULL; } - if (mSelectedObjects->mSelectType != SELECT_TYPE_HUD && gAgent.getAvatarObject()) + if (mSelectedObjects->mSelectType != SELECT_TYPE_HUD && isAgentAvatarValid()) { // reset hud ZOOM gAgentCamera.mHUDTargetZoom = 1.f; @@ -5642,10 +5640,10 @@ void LLSelectMgr::updateSelectionCenter() LLViewerObject* object = node->getObject(); if (!object) continue; - LLVOAvatarSelf *avatarp = gAgent.getAvatarObject(); + LLViewerObject *root = object->getRootEdit(); if (mSelectedObjects->mSelectType == SELECT_TYPE_WORLD && // not an attachment - !root->isChild(avatarp) && // not the object you're sitting on + !root->isChild(gAgentAvatar) && // not the object you're sitting on !object->isAvatar()) // not another avatar { mShowSelection = TRUE; |