summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorMark Palange <palange@lindenlab.com>2008-10-07 22:43:15 +0000
committerMark Palange <palange@lindenlab.com>2008-10-07 22:43:15 +0000
commitc9be97fdfcc6a4c6b23a8c90916af54a38d60ab0 (patch)
treeb0a7c83b643aff7a50208c3acd5caa4a9df1bbe2 /indra/newview/llviewermenu.cpp
parent9d7c56bf16f6c093c7b8d486f943e8d6df4d6a24 (diff)
merge r97380-98701 branches/viewer/viewer_1-21 (Viewer RC5 and security fixes) merge to trunk
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index d11598100e..7c78a26367 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -4934,13 +4934,20 @@ class LLToolsLookAtSelection : public view_listener_t
LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - selection_bbox.getCenterAgent();
obj_to_cam.normVec();
+ LLUUID object_id;
+ if (LLSelectMgr::getInstance()->getSelection()->getPrimaryObject())
+ {
+ object_id = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID;
+ }
if (zoom)
{
- gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), LLSelectMgr::getInstance()->getSelectionCenterGlobal(), LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID );
+ gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance),
+ LLSelectMgr::getInstance()->getSelectionCenterGlobal(),
+ object_id );
}
else
{
- gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID );
+ gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), object_id );
}
}
return true;