summaryrefslogtreecommitdiff
path: root/indra/newview/llagentcamera.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-02-23 10:44:59 -0700
committerXiaohong Bao <bao@lindenlab.com>2011-02-23 10:44:59 -0700
commit01cdeb0cdd8c48b76a229d42ced4e5563cd18c5c (patch)
treee7b7ca976f17c8af3c8a2648a801030594e94c8c /indra/newview/llagentcamera.cpp
parent7daa3d1ca10199468946feef0ce8eb67489deee0 (diff)
parentff5e3f5c2e566f3a8e86efaa763f7b12e07eeb53 (diff)
Merge from viewer-development
Diffstat (limited to 'indra/newview/llagentcamera.cpp')
-rw-r--r--indra/newview/llagentcamera.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 68e408d3e4..f01d5ff1f5 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -296,8 +296,11 @@ void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera)
LLSelectMgr::getInstance()->deselectAll();
}
- // Hide all popup menus
- gMenuHolder->hideMenus();
+ if (gMenuHolder != NULL)
+ {
+ // Hide all popup menus
+ gMenuHolder->hideMenus();
+ }
}
if (change_camera && !gSavedSettings.getBOOL("FreezeTime"))
@@ -2038,7 +2041,7 @@ void LLAgentCamera::resetCamera()
//-----------------------------------------------------------------------------
void LLAgentCamera::changeCameraToMouselook(BOOL animate)
{
- if (LLViewerJoystick::getInstance()->getOverrideCamera())
+ if (!gSavedSettings.getBOOL("EnableMouselook") || LLViewerJoystick::getInstance()->getOverrideCamera())
{
return;
}
@@ -2692,6 +2695,9 @@ void LLAgentCamera::lookAtLastChat()
new_camera_pos -= delta_pos * 0.4f;
new_camera_pos += left * 0.3f;
new_camera_pos += up * 0.2f;
+
+ setFocusOnAvatar(FALSE, FALSE);
+
if (chatter_av->mHeadp)
{
setFocusGlobal(gAgent.getPosGlobalFromAgent(chatter_av->mHeadp->getWorldPosition()), gAgent.getLastChatter());
@@ -2702,7 +2708,6 @@ void LLAgentCamera::lookAtLastChat()
setFocusGlobal(chatter->getPositionGlobal(), gAgent.getLastChatter());
mCameraFocusOffsetTarget = gAgent.getPosGlobalFromAgent(new_camera_pos) - chatter->getPositionGlobal();
}
- setFocusOnAvatar(FALSE, TRUE);
}
else
{
@@ -2722,9 +2727,10 @@ void LLAgentCamera::lookAtLastChat()
new_camera_pos += left * 0.3f;
new_camera_pos += up * 0.2f;
+ setFocusOnAvatar(FALSE, FALSE);
+
setFocusGlobal(chatter->getPositionGlobal(), gAgent.getLastChatter());
mCameraFocusOffsetTarget = gAgent.getPosGlobalFromAgent(new_camera_pos) - chatter->getPositionGlobal();
- setFocusOnAvatar(FALSE, TRUE);
}
}