summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r--indra/newview/llagent.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 881ce538f4..cea67fb61f 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -5002,14 +5002,20 @@ static S32 g_deltaFrame { 0 };
void LLAgent::updateGameControlMode()
{
- // Auto-derive the active mode from avatar state. Flycam takes precedence
- // (it is toggled via a game-control binding), then sitting/controls-taken
- // maps to Captive, otherwise the normal Avatar mode.
+ // Auto-derive the active mode from avatar/camera state. Flycam takes
+ // precedence (it is toggled via a game-control binding), then mouselook
+ // (the camera mode can be entered while sitting too, so it is checked
+ // ahead of Captive), then sitting/controls-taken maps to Captive,
+ // otherwise the normal Avatar mode.
LLGameControl::AgentControlMode mode;
if (mUsingFlycam)
{
mode = LLGameControl::CONTROL_MODE_FLYCAM;
}
+ else if (gAgentCamera.cameraMouselook())
+ {
+ mode = LLGameControl::CONTROL_MODE_MOUSELOOK;
+ }
else if (isSitting())
{
mode = LLGameControl::CONTROL_MODE_CAPTIVE;